$ dpkg -L netkiller|more /. /opt /opt/neo /opt/neo/netkiller-1.0 /opt/neo/netkiller-1.0/linux /opt/neo/netkiller-1.0/linux/docbook.css /opt/neo/netkiller-1.0/linux/apas03.html /opt/neo/netkiller-1.0/linux/shell
$ sudo dpkg -l netkiller $ dpkg -l netkiller Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ un netkiller <none> (no description available)
系统上装了哪些软件包
要查看 Debian 系统上安装的所有软件包的状态, 运行 dpkg --list 输出每个软件包的一行简单介绍, 2字符的状态标志, 包名, 所安装版本, 和简要描述. 查看以 "foo" 开头的软件包的状态, 执行: dpkg --list 'foo*' 要得到某个软件包的更详细信息, 执行: dpkg --status packagename
List of installed software packages
$ dpkg-query -W
Description of installed software packages
$ dpkg -l
找出一个文件的归属包
dpkg --search cachemgr squid3-cgi: /usr/lib/cgi-bin/cachemgr3.cgi squid3-cgi: /usr/share/man/man8/cachemgr3.cgi.8.gz squid3-cgi: /etc/squid3/cachemgr.conf
$ dpkg -X dmd_2.057-0_amd64.deb dmd_2.057-0_amd64
$ dpkg -e dmd_2.057-0_amd64.deb $ find DEBIAN/ DEBIAN/ DEBIAN/conffiles DEBIAN/md5sum DEBIAN/control
在你的目录下创建DEBIAN目录与control文件
mkdir DEBIAN/ cat >> DEBIAN/control <<EOF Package: netkiller Version: 1.0-0 Architecture: amd64 Maintainer: Neo Chen <netkiller@msn.com> Installed-Size: 51196 Depends: libc6-dev, gcc, gcc-multilib, libc6 (>= 2.11), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1) Section: devel Priority: optional Description: Netkiller ebook . Main designer: Neo Chen . Homepage: http://netkiller.github.com/ . EOF
$ dpkg -b dlang dlang.deb dpkg-deb: building package `netkiller' in `dlang.deb'. $ dpkg --info dlang.deb new debian package, version 2.0. size 263266 bytes: control archive= 371 bytes. 354 bytes, 14 lines control Package: netkiller Version: 1.0-0 Architecture: amd64 Maintainer: Neo Chen <netkiller@msn.com> Installed-Size: 51196 Depends: libc6-dev, gcc, gcc-multilib, libc6 (>= 2.11), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1) Section: devel Priority: optional Description: Netkiller ebook . Main designer: Neo Chen . Homepage: http://netkiller.github.com/ . $ dpkg --contents dlang.deb drwxr-xr-x neo/neo 0 2012-02-06 11:22 ./ -rw-r--r-- neo/neo 144 2012-02-01 16:35 ./hello.lst -rwxr-xr-x neo/neo 321 2012-01-08 21:25 ./test.d -rw-r--r-- neo/neo 207 2012-02-01 15:57 ./d4py.d -rwxr-xr-x neo/neo 919366 2012-02-01 16:28 ./hello -rw-r--r-- neo/neo 6452 2012-02-01 16:28 ./hello.o -rwxr--r-- neo/neo 80 2012-01-08 21:28 ./hello.d
$ sudo dpkg-reconfigure package
所有未完成的配置步骤,主要是你在安装过程中出现中断后,可以使用下面命令补救。
$ sudo dpkg --configure -a
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。