dpkg stands for Debian Package is a Package Manager for Debian and it’s derivatives Linux Operating System. dpkg is one of the built-in command in Debian based system.
It is to install, remove, queries and manage individual .deb packages. In this article, we will have a look some of the dpkg commands which may be useful day to day operation for system administrator.
dpkg – [option…] action
1. List all installed packages in the system.
$ dpkg -l
2. List a particular package only.
$ dpkg -l sysstat
3. How to check and view contents of a package.
$ dpkg –contents mysql-apt-config_0.8.14-1_all.deb
4. Install or upgrade package
$ sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
5. To remove package from system
$ sudo dpkg -r mysql-apt-config_0.8.14-1_all.deb
6. Find the details and location of installed package
$ dpkg -L sysstat
7. Package is installed or not and shows package details if it is installed.
$ sudo dpkg -s sysstat
8. Unpacking package. It will not install and configure the package.
$ sudo dpkg –unpack mysql-apt-config_0.8.14-1_all.deb
9. Print architecture of dpkg package.
$ dpkg –print-architecture
10. Get help and you can always use below command to explore and read more about dpkg command.
$ dpkg –help
$ man dpkg
That’s it. There are number options available with dpkg command. we have covered some of them which is used daily operations. If you are using other than what is shown above, kindly share it through comment box below.