What is dpkg in Linux?
`dpkg` (Debian Package) is a low-level package management system for Debian-based Linux distributions, such as Ubuntu. It handles the installation, configuration, upgrade, and removal of software packages. Unlike higher-level tools like `apt`, which resolve dependencies and download packages from repositories, `dpkg` directly manages individual `.deb` files, making it essential for managing local packages and performing detailed package operations.
Basic Syntax
dpkg [options] action
Here,
options – optional tags that modify the behavior of dpkg
action – specifies what dpkg should do
Common Actions of dpkg
The following are the common actions of dpkg:
Option |
Behavior of option |
---|---|
-i or –install |
to install a package |
-r or –remove |
to remove a package |
-p or –pure |
to remove a package with long its dependencies. |
-s or –status |
It shows the status of a package. |
Example
- The following command is used to install a page from .deb files:
sudo dpkg -i package_name.deb
Debian Software Package Management(dpkg) in Linux
In Linux, there are a lot of different distributions and each of these distributions has a different package type. For example .rpm or Red hat Package Manager is used as the package in the Linux distribution. A package is the compressed version of the software.
In this article, we will go through the Debian package which is used by Ubuntu. D package or Debian Package is used to install and download the software in Debian based Linux systems. Debian files end with .deb extension.
Table of Content
- What is dpkg in Linux?
- Basic Syntax
- Common Actions of dpkg
- Example
- dpkg commands in Linux with Examples
- Linux dpkg – FAQs