$ 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