-->

How to use DPKG commands in Linux

Author Piyush Gupta

DPKG is the main package management program in Debian and Debian based System. It is used to install, build, remove, and manage packages. Aptitude is the primary front-end to dpkg.

Some the most commonly used dpkg commands along with their usages are listed in below table:

COMMAND DETAILS
DPKG COMMAND
Install a package
dpkg -i {file.deb}
Update package
dpkg -i {file.deb}
Remove an installed package
dpkg -r {package}
List all installed packages
dpkg -l
List files in an installed package
dpkg -L {package}
Show information about installed package
dpkg -p {package}
Show information about package file
dpkg -I {file.deb}
List files in a package file
dpkg -c {file.deb}

Example:

For installing packages on debian based system we use dpkg (Debian Package Management System) command.
sudo dpkg -i package.deb

Installing Package:

To install a Google chrome from a deabian package file (google-chrome-stable_current_i386.deb) use -i command line switch.
$ sudo dpkg -i google-chrome-stable_current_i386.deb

Removing Package:

In case if we need to remove any package use -r command line switch with package name.
$ sudo dpkg -r google-chrome-stable_current_i386.deb

No comments:

Post a Comment