2.4. PKGNG - Pkgng is the Next Generation package management tool for FreeBSD.

https://mebsd.com/make-build-your-freebsd-word/pkgng-first-look-at-freebsds-new-package-manager.html

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/pkgng-intro.html

https://wiki.freebsd.org/pkgng

2.4.1. 安装 pkgng

方法一:

# /usr/sbin/pkg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg please wait
Installing pkg-1.0.11... done
If you are upgrading from the old package format, first run:

  # pkg2ng
usage: pkg [-v] [-d] [-j <jail name or id>|-c <chroot path>] <command> [<args>]

Global options supported:
	-d             Increment debug level
	-j             Execute pkg(1) inside a jail(8)
	-c             Execute pkg(1) inside a chroot(8)
	-v             Display pkg(1) version

Commands supported:
	add            Registers a package and installs it on the system
	audit          Reports vulnerable packages
	autoremove     Removes orphan packages
	backup         Backs-up and restores the local package database
	check          Checks for missing dependencies and database consistency
	clean          Cleans old packages from the cache
	create         Creates software package distributions
	delete         Deletes packages from the database and the system
	fetch          Fetches packages from a remote repository
	help           Displays help information
	info           Displays information about installed packages
	install        Installs packages from remote package repositories
	query          Queries information about installed packages
	register       Registers a package into the local database
	remove         Deletes packages from the database and the system
	repo           Creates a package repository catalogue
	rquery         Queries information in repository catalogues
	search         Performs a search of package repository catalogues
	set            Modifies information about packages in the local database
	shell          Opens a debug shell
	shlib          Displays which packages link against a specific shared library
	stats          Displays package database statistics
	update         Updates package repository catalogues
	updating       Displays UPDATING information for a package
	upgrade        Performs upgrades of packaged software distributions
	version        Displays the versions of installed packages
	which          Displays which package installed a specific file

For more information on the different commands see 'pkg help <command>'.

方法二:

# portsnap fetch update
# cd /usr/ports/ports-mgmt/pkg
# make
# make install clean
			

方法三

# pkg_add -r pkg
			

2.4.2. 转换数据库

运行 pkg2ng 命令

# pkg2ng
			

设置 make.conf 文件

cat >> /etc/make.conf <<EOF

WITH_PKGNG=yes
EOF

2.4.3. install

安装包

# pkg install curl
			

2.4.4. delete

删除包

# pkg delete curl
			

2.4.5. info

显示所有包信息

pkg info
			

显示包之间的依赖关系

# pkg info -d subversion
subversion-1.7.7 depends on:
expat-2.0.1_2
pkgconf-0.8.9
sqlite3-3.7.14.1
gdbm-1.9.1
db42-4.2.52_5
libiconv-1.14
gettext-0.18.1.1
			

显示包中的文件

# pkg info -l subversion
subversion-1.7.7 owns the following files:
/usr/local/bin/svn
/usr/local/bin/svnadmin
/usr/local/bin/svndumpfilter
/usr/local/bin/svnlook
/usr/local/bin/svnrdump
/usr/local/bin/svnserve
/usr/local/bin/svnsync
/usr/local/bin/svnversion
/usr/local/etc/rc.d/svnserve
			

2.4.6. query

# pkg query "Package name = %n, Version = %v, Size = %sh" libxml2
Package name = libxml2, Version = 2.7.8_5, Size = 4 MB

# pkg query -a "Package name = %n, Version = %v, Size = %sh"
			
# pkg query "\
	package[%n]\n\
	version[%v]\n\
	origin[%o]\n\
	prefix[%p]\n\
	maintainer[%m]\n\
	comment[%c]\n\
	www[%w]\n\
	licenselogic[%l]\n\
	flatsize[%sh]\n\
	flatsizebytes[%sb]\n\
	orphan[%a]\n\
	message[%M]\n\
" libxml2

typescript package[libxml2]

typescript version[2.7.8_5]

typescript origin[textproc/libxml2]

typescript prefix[/usr/local]

typescript maintainer[gnome@FreeBSD.org]

typescript comment[XML parser library for GNOME]

typescript www[http://xmlsoft.org/]

typescript licenselogic[single]

typescript flatsize[4 MB]

typescript flatsizebytes[4258960]

typescript orphan[0]

typescript message[]

2.4.7. upgrade

# pkg upgrade
		

原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

时间: 2024-10-26 17:46:22

2.4. PKGNG - Pkgng is the Next Generation package management tool for FreeBSD.的相关文章

FreeBSD 包管里pkgng

文章出处:http://netkiller.github.io/freebsd/index.html PKGNG - Pkgng is the Next Generation package management tool for FreeBSD.   2.4.1. 安装 pkgng 方法一: # /usr/sbin/pkg The package management tool is not yet installed on your system. Do you want to fetch

[文档]Towards Cloud Deployments using FutureGrid

Towards Cloud Deployments using FutureGrid Javier Diaz, Gregor von Laszewski, Fugang Wang, Geoffrey C. Fox In this document we briefly outline some differences between IaaS frameworks Eucalyptus, OpenNebula, OpenStack and Nimbus. We provide also an o

44个JAVA代码质量管理工具(转)

  1. CodePro AnalytixIt's a great tool (Eclipse plugin) for improving software quality. It has the next key features: Code Analysis, JUnit Test Generation, JUnit Test Editor, Similar Code Analysis, Metrics, Code Coverage and Dependency Analysis.2. PM

加密学教程(Cryptography Tuturials)目录

加密学教程(Cryptography Tuturials) 太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 Cryptography Tutorials - Herong's Tutorial Notes Version 4.00 Dr. Herong Yang Copyright 1998 - 2007 by Dr. Herong Yang. All rights reserved. Table

Changing the Way of Continuous Delivery with Docker (Part 1)

Introduction This post is the first part of the series "Changing the Way of Continuous Delivery with Docker" and discusses the background, challenges, and processes involving Docker. Docker is a service for reformed continuous delivery. In the s

详解ASP.NET Core Token认证_实用技巧

令牌认证(Token Authentication)已经成为单页应用(SPA)和移动应用事实上的标准.即使是传统的B/S应用也能利用其优点.优点很明白:极少的服务端数据管理.可扩展性.可以使用单独的认证服务器和应用服务器分离. 如果你对令牌(token)不是太了解,可以看这篇文章( overview of token authentication and JWTs) 令牌认证在asp.net core中集成.其中包括保护Bearer Jwt的路由功能,但是移除了生成token和验证token的部

IBM的BPM Zero项目:RESTful工作流管理

IBM的卓越工程师Christina Lau最近在Devoxx大会上做了一个题为"BPM 2.0--针对下一代工作流管理的REST架构(BPM 2.0 – a REST based architecture for next generation workflow management)"的演讲.该演讲的目标在于帮助我们更好的理解BPM-as-a-Service(BaaS)以便为之做好充分的准备. 根据Rashid Khan对该主题的评论,她使用了5个关键概念来定义BaaS: 宿主环境

[20150608]dbms_random.value.txt

[20150608]dbms_random.value.txt --11.2.0.3与11.2.0.4下,调用dbms_random.value存在很大的差异,测试看看: SCOTT@test> @ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- -----------------------------------------------

Awesome Python

    Awesome Python      A curated list of awesome Python frameworks, libraries, software and resources. Inspired by awesome-php. Awesome Python Environment Management Package Management Package Repositories Distribution Build Tools Interactive Interp