2011年4月23日星期六

dpkg笔记

但愿这是一个不多不少的好工具。

维基百科的描述
dpkg is the software at the base of the Debian package management system. dpkg is used to install, remove, and provide information about .deb packages.
dpkg itself is a low level tool; higher level tools, such as APT, are used to fetch packages from remote locations or deal with complex package relations. Tools like aptitude or synaptic are more commonly used than dpkg on its own, as they have a more sophisticated way of dealing with package relationships and a friendlier interface.

dpkg是一个管理的范围限于本地。

安装和移除
1. 从.deb文件安装
dpkg -i, --install package_file...
2. 移除包
dpkg -r, --remove, -P, --purge package...|-a|--pending

dpkg-deb,.deb文件相关命令
1. 创建.deb包
dpkg -b, --build directory [archive|directory]
2. 列出.deb文件内容
dpkg -c, --contents archive
3. 从.deb文件中提取控制信息(control-information)
dpkg -e, --control archive directory
4. 提取文件
dpkg -x, --extract archive directory
5. 提取文件名
dpkg -X, -vextract archive directory
6. 显示包的控制字段(control field(s))
dpkg -f, --field archive [control-field...]
7. 显示.deb文件中所包含的tar文件
dpkg --fsys-tarfile archive
8. 显示包文件的综合信息
dpkg -I, --info archive [control-file...]

dpkg-query,查询已安装包的相关信息
1. 列出匹配的包,若不指定参数,则列出当前系统已安装的所有包(名字,版本,简要描述)
dpkg -l, --list package-name-pattern...
2. 列出某个包当前在系统中的状态
dpkg -s, --status package-name...
3. 列出与包相关的文件
dpkg -L, --listfiles package-name...
4. 从已安装的包中查找某个文件
dpkg -S, --search filename-search-pattern...
5. 显示某个包的细节信息,(信息源来自/var/lib/dpkg/available)
dpkg -p, --print-avail package-name...



参考资料:
[1]. Dpkg 常用指令操作快速参考,http://linuxtoy.org/archives/dpkg_reference.html
[2]. The Debian package management tools,http://www.debian.org/doc/FAQ/ch-pkgtools.en.html#s-dpkg

没有评论:

发表评论