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 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
时间: 2024-09-09 01:25:30

FreeBSD 包管里pkgng的相关文章

对freebsd vmstat结果内容的解释

top是给Linux设计的.在FreeBSD VM里面的Free概念和其他OS完全不同,使用top查看Free内存对于FreeBSD来说可以说没什么意义.正确的方法是看vmstat. procs memory page disk faults cpu r b w swap free re mf mi po fr de sr f0 s0 s1 s2 in sy cs us sy id 0 0 0 14888 19120 0 4 2 11 10 0 0 0 0 0 8 198 2158 98 11

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 pa

FreeBSD里mysql重启命令实例

mysql-server参数: Usage: ./mysql-server [fast|force|one](start|stop|restart|rcvar|status|poll) 例 # cd /usr/local/etc/rc.d/ # ./mysql-server restart Stopping mysql. Waiting for PIDS: 71125. Starting mysql.

Freebsd+Resin成功建立支持jsp平台

js 环境:FreeBsd 4.9 Apache1.3.29+php4.3.4+mysql4+ports 安装 首先要cvsup同步ports , /usr/local/bin/cvsup -g -L 2 /usr/local/etc/ports-supfile /usr/local/bin/cvsup -g -L 2 /usr/local/etc/stable-supfile 然后进入http://www.freebsd.org/ports/java.html 进入bsd 关于java 的官方

FreeBSD平台下Web服务器架设攻略

在FreeBSD系统中,一个标准的FreeBSD系统,至少要有一个网络界面以便与其他计算机通信.它支持Token Ring和FDDI,以及普通电话拨号连接.ISDN.ATM等广域网连接方式.本文要讨论的是基于此系统平台下的WEB服务的组建情况,FreeBSD的使用版本为4.7. 一.接入Internet 配置的第一步就是让FreeBSD接入Internet并设置好代理服务.本机使用ADSL接入Internet有两种情况,即通过拨号获取的动态ip或ISP提供的静态ip.以下主要介绍动态IP的配置过

FreeBSD下构建安全的Web服务器(1)

序言 在我们跑Web服务器的时候,大家可能都会一致认为使用Linux+Mysql+Apache+PHP整个开源的系统是比较好的选择,但是我个人认为这是不合理的,首先要根据你的应用来觉得你使用什么服务.假如你需要跑Oracle等大型应用的话,而且Oracle在Linux下是支持的比较好的,那么使用Linux是个好的选择,因为在FreeBSD下安装Oracle是个非常麻烦的事情.那么如果是跑普通的网站应用的话,我觉得使用FreeBSD+Mysql+Apache+PHP是个好的选择,因为对于一个网站来

FreeBSD下构建安全的Web服务器(3)

web|web服务|web服务器|安全 对于使用php脚本来进行交互,最好建立一个用户只针对某个库有 update.select.delete.insert.drop table.create table等权限,这样就很好避免了数据库用户名和密码被黑客查看后最小损失. 比如下面我们创建一个数据库为db1,同时建立一个用户test1能够访问该数据库. mysql> create database db1; mysql> grant select,insert,update,delete,crea

FreeBSD 5.0RC1下安装Oracle 9i[总结]

oracle 花了好几天进行Oracle 9i在FreeBSD 5.0RC1下的安装,虽然最终并没有获得成功.但是收获良多.因为我并不是一定要在FreeBSD下使用Oracle,作这次安装测试有点废物利用的意味.没有成功,但是也算是全败. 至少证明:VIA C3 1G这个CPU还行,FreeBSD5.0的性能不错,至少在编译时要比我安装过的Mandrake和Redhat快.Oracle9i不能用与这么低的配置有关系,我会找时间尝试安装Oracle 8i.或者:根本不用Oracle,MySQL和P

在FreeBSD上使用软RAID-1

有没有想过为低端服务器做软 RAID?你或许想过在不购置硬 RAID 控制卡的前提下,通过磁盘镜像为 你的工作站带来冗余保护.你是否有过痛苦的配置经历,使你对 Unix 系统上的软 RAID 却步? FreeBSD 5.3 及更高的版本加入了 gmirror(8):它让你轻易地配置使用软 RAID 1.尽管 gmirror 已有不少教程,但我发现它们不是要求用 bsdlabel 来手动计算分区的大小就是要用到一张用以 修正现有系统的软盘. 我以为在安装操作系统的过程中配置 RAID 更为合理.我