$ sudo dpkg -iR /opt/software Selecting previously unselected package atom. (Reading database ... 423303 files and directories currently installed.) Preparing to unpack /opt/software/atom-amd64.deb ... Unpacking atom (1.5.3) ... Setting up atom (1.5.3) ... Processing triggers for gnome-menus (3.13.3-6ubuntu1) ... Processing triggers for bamfdaemon (0.5.2~bzr0+15.10.20150627.1-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for desktop-file-utils (0.22-1ubuntu3) ... Processing triggers for mime-support (3.58ubuntu1) ...
4) 显示已安装软件列表
以下命令可以列出 Debian 系的系统中所有已安装的软件,同时会显示软件版本和描述信息。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
$ dpkg -l 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 Architecture Description +++-===========================-==================================-============-================================================================ ii account-plugin-aim 3.12.10-0ubuntu2 amd64 Messaging account pluginfor AIM ii account-plugin-facebook 0.12+15.10.20150723-0ubuntu1 all GNOME Control Center account pluginfor single signon - facebook ii account-plugin-flickr 0.12+15.10.20150723-0ubuntu1 all GNOME Control Center account pluginfor single signon - flickr ii account-plugin-google 0.12+15.10.20150723-0ubuntu1 all GNOME Control Center account pluginfor single signon ii account-plugin-jabber 3.12.10-0ubuntu2 amd64 Messaging account pluginfor Jabber/XMPP ii account-plugin-salut 3.12.10-0ubuntu2 amd64 Messaging account pluginforLocal XMPP (Salut) . .
5) 查看指定的已安装软件
用以下命令列出指定的一个已安装软件,同时会显示软件版本和描述信息。
1 2 3 4 5 6 7 8
$ dpkg -l atom 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 Architecture Description +++-==========-=========-===================-============================================ ii atom 1.5.3 amd64 A hackable text editor for the 21st Century.
$ dpkg -s atom Package: atom Status: install ok installed Priority: optional Section: devel Installed-Size: 213496 Maintainer: GitHub <atom@github.com>Architecture: amd64 Version:1.5.3 Depends: git, gconf2, gconf-service, libgtk2.0-0, libudev0 | libudev1, libgcrypt11 | libgcrypt20, libnotify4, libxtst6, libnss3, python, gvfs-bin, xdg-utils, libcap2 Recommends: lsb-release Suggests: libgnome-keyring0, gir1.2-gnomekeyring-1.0 Description: A hackable text editor for the 21st Century. Atom is a free and open source text editor that is modern, approachable, and hackable to the core.</atom@github.com>
9) 查看文件属于哪个软件
用以下命令来查看文件属于哪个软件。
1 2 3
$ dpkg -S /usr/bin/atom atom:/usr/bin/atom
10) 移除/删除软件
以下命令可以用来移除/删除一个已经安装的软件,但不删除配置文件。
1 2 3 4 5 6 7 8 9
$ sudo dpkg -r atom (Reading database ... 426404 files and directories currently installed.) Removing atom (1.5.3) ... Processing triggers for gnome-menus (3.13.3-6ubuntu1) ... Processing triggers for bamfdaemon (0.5.2~bzr0+15.10.20150627.1-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for desktop-file-utils (0.22-1ubuntu3) ... Processing triggers for mime-support (3.58ubuntu1) ...
11) 清除软件
以下命令可以用来移除/删除包括配置文件在内的所有文件。
1 2 3 4 5 6 7 8 9
$ sudo dpkg -P atom (Reading database ... 426404 files and directories currently installed.) Removing atom (1.5.3) ... Processing triggers for gnome-menus (3.13.3-6ubuntu1) ... Processing triggers for bamfdaemon (0.5.2~bzr0+15.10.20150627.1-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for desktop-file-utils (0.22-1ubuntu3) ... Processing triggers for mime-support (3.58ubuntu1) ...