A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/linux-unix/debian-software-package-managementdpkg-in-linux/ below:

Debian Software Package Management(dpkg) in Linux

Debian Software Package Management(dpkg) in Linux

Last Updated : 23 Jul, 2025

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.

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
sudo dpkg -i package_name.deb
dpkg commands in Linux with Examples

1. Installing a stand-alone package using the Debian package

sudo dpkg -i name_of_package.deb

Example: To download standalone package for the open-source text editor, atom

sudo dpkg -i atom-amd64.deb

2. Removing a package using the Debian package

sudo dpkg -r name_of_package

Example: To remove the package for the text editor "atom"

sudo dpkg -r atom

Note: -P flag helps to remove everything including conf files.

dpkg -P [package-name]
dpkg -P googler_3.3.0-1_all.deb

3. Listing the debian packages

dpkg -l
dpkg -l | grep name_of_package.

4. List the dpkg commands available

dpkg –help

5. View the content of a particular package

dpkg -c [name of the package]
dpkg -c flashplugin-nonfree_3.2_i386.deb

6. Print architecture of dpkg installs

dpkg --print-architecture

7. Unpack a package

dpkg --unpack [package-name]
dpkg --unpack flashplugin-nonfree_3.2_i386.deb
dpkg --configure [package-name]
dpkg --configure flashplugin-nonfree

8. Check if the package is installed or not

dpkg -s [package-name]
dpkg -s git

9. Reconfigure the installed package

dpkg-reconfigure [package-name]

Locate the installed package

dpkg -L [package-name]
dpkg -L git

10. Check for any issue with the installed package

dpkg --audit

11. Erase information 

dpkg –-clear-avail

12. Display dpkg version

sudo dpkg --version


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4