12 DPKG command examples
Introduction The package manager for Debian and distros derived from Debian is called dpkg or Debian package. As users, we can use dpkg directly or use higher level programs like apt(advanced package management tool) which gives us a few more features. Utilities such as dpkg-deb and dpkg-query use dpkg as a front-end to perform some actions. In this article, we will demonstrate how you can use the dpkg package manager to list, install, uninstall and query package on an Ubuntu 16.04 system. Example 1: Display dpkg version To display the version of the dpkg package manager installed on your system use the dpkg command with the –version option. root@linuxnix:~# dpkg --version Debian 'dpkg' package management program version 1.18.4 (amd64). This is free software; see the GNU General Public License version 2 or later for copying conditions. There is NO warranty. root@linuxnix:~# Example 2: List all installed packages Using the dpkg command with the -l option lists all packages currently installed on the system. root@linuxnix:~# 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 accountsservice 0.6.40-2ubuntu11.1 amd64 query and manipulate user account information ii adduser 3.113+nmu3ubuntu4 all add and remove users and groups ii apparmor 2.10.95-0ubuntu2 amd64 user-space parser utility for AppArmor ii apt 1.2.12~ubuntu16.04.1 amd64 commandline package manager ii apt-transport-https 1.2.12~ubuntu16.04.1 amd64 https download transport for APT -----------------------------------------------------------output truncated for brevity...
Read More