dpkg 常用命令
列出源中所有安装包
root@debian:~# apt-cache search all |more flashplugin-nonfree - Adobe Flash Player - browser plugin ttf-mscorefonts-installer - Installer for Microsoft TrueType core fonts iucode-tool - Intel processor microcode tool nvidia-installer-cleanup - Cleanup after driver installation with the nvidia-installer glx-alternative-mesa - allows the selection of MESA as GLX provider gcc-4.7-base - GCC, the GNU Compiler Collection (base package) libc6 - Embedded GNU C Library: Shared libraries libbz2-1.0 - high-quality block-sorting file compressor library - runtime libselinux1 - SELinux runtime shared libraries tar - GNU version of the tar archiving utility dpkg - Debian package management system perl-base - minimal Perl system
查看源里的安装包
root@debian:~# apt-cache search memcached memcached - A high-performance memory object caching system nginx-extras - nginx web/proxy server (extended version) nginx-full - nginx web/proxy server (standard version) nginx-naxsi - nginx web/proxy server (version with naxsi) root@debian:~# apt-cache search all|grep memcached memcached - A high-performance memory object caching system
列出安装包的详细路径
root@debian:~# dpkg -L vim /. /usr /usr/bin /usr/bin/vim.basic /usr/share /usr/share/doc /usr/share/bug /usr/share/bug/vim /usr/share/bug/vim/script /usr/share/bug/vim/presubj /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/vim /usr/share/doc/vim
查看包的信息
root@debian:~# dpkg -s vim Package: vim Status: install ok installed Priority: optional Section: editors Installed-Size: 1877 Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> Architecture: amd64 Version: 2:7.3.547-7 Provides: editor Depends: vim-common (= 2:7.3.547-7), vim-runtime (= 2:7.3.547-7), libacl1 (>= 2.2.51-8), libc6 (>= 2.11), libgpm2 (>= 1.20.4), libselinux1 (>= 1.32), libtinfo5 Suggests: ctags, vim-doc, vim-scripts Description: Vi IMproved - enhanced vi editor
查看系统中的某个文件属于那个软件包
root@debian:~# dpkg -S /etc/vim/vimrc vim-common: /etc/vim/vimrc
查看已经安装的包
vim-common: /etc/vim/vimrc root@debian:~# dpkg -l |grep vim ii vim 2:7.3.547-7 amd64 Vi IMproved - enhanced vi editor ii vim-common 2:7.3.547-7 amd64 Vi IMproved - Common files ii vim-runtime 2:7.3.547-7 all Vi IMproved - Runtime files ii vim-tiny 2:7.3.547-7 amd64 Vi IMproved - enhanced vi editor - compact version
deb文件的安装 dpkg -i
deb程序的卸载 dpkg -r
彻底的卸载,包括软件的配置文件 dpkg -P
本文出自 “魂斗罗” 博客,请务必保留此出处http://990487026.blog.51cto.com/10133282/1728422
原文地址:http://990487026.blog.51cto.com/10133282/1728422