Getting Began With Dpkg on Debian-Primarily based Linux Distros

The software you run on your PC really makes it personal. It says a lot about what you work with, what you enjoy doing, or what hobbies you have.

This guide explains how to use the Debian Package Manager (dpkg) to manage software packages on Debian-based Linux distributions like Ubuntu, Debian, Mint and Kali etc. Debian software packages have a .deb extension.

Software management is one of the most common tasks you perform on your PC or as a system administrator.

What is dpkg

Dpkg is a low-level utility that consists of a series of commands used to install, remove, list, and manage software packages on Debian-based Linux distributions.

The dpkg utility is the foundation upon which other software management tools such as Apt and Synaptic are built. These are classified as higher-level software management tools.

The local installation of Debian (.deb) software package files on your PC is one of the special features of dpkg.

This is particularly important when installing software on computers that are network-independent for security reasons or because of network connection problems. Notable software packages that can be installed with dpkg include VS Code, Google Chrome, and VirtualBox, to name a few.

List of installed software packages

Just run the following command to see a list of the software packages installed on your computer.

dpkg –get-selections

The –get selection The command option displays installed package names in a simple and clean format.

You can use the following command to view available version details for installed packages. It also lists information such as software version, installed size, origin, priority, etc.

dpkg –print-available

When you want to view software package information in tabular form. You can use the … dpkg query Command as follows.

dpkg-query –list

Install software packages

Installing software packages is one of the most common tasks we do on our PCs. Before you can use dpkg to install software packages on your computer, you must first download the software package and make it available locally. You can easily download software packages with your browser or through tools like wget or curl.

You need elevated privileges to install and remove software packages using dpkg.

For example, download Google Chrome to the Downloads folder to install it. Then just run the following command.

sudo dpkg –install ~ / Downloads / google-chrome-stable_current_amd64.deb

Restore dependencies

Software packages on Linux often depend on other pieces of software to function smoothly.

When installing packages via dpkg it is often a good idea to restore dependencies with apt using the following command to make sure everything is working properly.

sudo apt install -f

Tip: You can use a short form for most of the dpkg commands. For example, dpkg -i package-name instead of dpkg –install_package_name for installing software packages. The latter approach is used in this guide because the long commands are more self-explanatory.

Related Topics: How to Find and Fix Broken Packages on Linux

Update software

Keeping your system up to date is a good safeguard against security breaches and is the key to a more stable and robust system.

To update software packages installed via dpkg, you must first download the newer package and then install it using the installation command described in the section above.

To check for broken packages, use the – Exam Possibility. This command option checks that all packages have been installed correctly and that any dependencies are missing. If a package is broken, the dpkg utility will give you advice on suggested fixes.

dpkg –audit

Reconfiguration of a software package

Another powerful option that dpkg offers is the ability to reconfigure an already installed software package. For example, to reconfigure VirtualBox you can run the following command. A configuration screen will appear.

reconfigure sudo dpkg-virtualbox-6.1

Remove software packages

When you no longer need software and are ready to remove it, or when you want to remove it to update the software, you can use it –remove Command option.

sudo dpkg – Remove Google Chrome Stable

(In the above command Google chrome stable is the package name)

If you remove software packages with the –remove option, the configuration files associated with the package to be removed are retained. The next time you reinstall this software, the previous configurations will be used.

To completely remove a software package and its configurations, you can use the –purge option.

sudo dpkg – clean google chrome stall

Get information about a software package

Please contact for more information about the package you want to install with –the information.

sudo dpkg –info ~ / Downloads / google-chrome-stable_current_amd64.deb

The output contains information such as the software architecture, the maintainer and the version number, etc.

Check the software package contents

You can also check the contents of a Debian package with –Content. The listing describes the directory structure of the package and all important files such as the software license and other manifest files.

dpkg –contents ~ / Downloads / google-chrome-stable_current_amd64.deb

The package contents are displayed in a long list format as below.

Find out if a package is installed

With the you can easily check whether a software package has been installed on your computer –Status Possibility. For example, to find out if Zoom has been installed on your system, just run the following command.

sudo dpkg –status zoom

Other details will also appear in the output, such as: B. the purpose of the software package and the provider.

An example output looks like this. For example, line two of the command output shows the status of the package. As you can see from the output, the zoom package is installed on this particular computer.

You can search their official website for package directories that qualify for free distribution under Debian standards.

Read More

get help

To learn more about the dpkg command, you can use the command–Help Possibility.

dpkg –help

For more information about dpkg command options and the status of software packages, see the man pages.

Man dpkg

What about alternative package managers?

dpkg is a powerful utility for installing and managing software packages. Higher-level tools such as apt and synaptic use dpkg. Other alternatives for installing packages are Apt, Synaptic, and Aptitude.

A Beginner's Guide to Installing Software in Ubuntu Using APT

If you've used Ubuntu, you've probably used the apt command at some point. But did you know there is so much more to it than apt-get install and apt-get upgrade?

Continue reading

About the author

Mwiza Kumwenda
(2 articles published)

Mwiza is a professional developer of software and writes extensively on Linux and front-end programming. Some of his interests include history, economics, politics, and enterprise architecture.

More
By Mwiza Kumwenda

Subscribe to our newsletter

Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive deals!

One more step …!

Please confirm your email address in the email we just sent you.

Leave a Reply

Your email address will not be published. Required fields are marked *