5 Debian Package Management Tools you need to know

text
Reading Time: 4 minutes
DevOps : Debian Package Manager

Hi everyone! Today in this tutorial, we’re going to look at 5 different package management tools that Debian uses specially in DevOps.

Above all, Before diving in, lets take a brief look at what Package Management actually is.

What is Package Management?

Firstly, A package generally refers to a compressed file archive containing all the files that come with a particular application. These are referred to as dependencies.

Secondly, The task of finding, installing, maintaining, upgrading or uninstalling these software packages upon the user’s command is handled by a Package Manager.

It presents an interface which assists the users in managing the collection of packages installed on their system.In conclusion , the process is known as Package Management.

Moreoever, Debian package files typically has the extension .deb.

Additionally, They are stored in repositories which are collections of packages found online or on physical media.

However, Packages normally come in a pre-compiled binary format which makes their installation quick and there is no longer a need of compiling the software.

There are multiple tools that are used to manage Debian packages, from graphic or text-based interfaces to the low level tools.Finally, Let’s discuss 5 of them one by one.

1. Debian dpkg

Firstly, It stands for Package Manager for Debian. It is a tool to install, build, remove and manage Debian
packages.

SYNOPSIS – dpkg [option...] action

dpkg is controlled entirely via command line parameters, which consist of exactly one action and zero or more options. Here, the action-parameter tells dpkg what to do and options control the behaviour of the action in some way. Let’s get our hands dirty with some basic commands used to manage locally installed packages.

Command Function
dpkg --help
For finding out all the options
dpkg --info foo_VVV-RRR.deb
For printing out the control file and
other information for a specific package
dpkg --install foo_VVV-RRR.deb
For installing a package including unpacking and configuring
dpkg --remove foo
For removing a package but not its configuration files
dpkg --purge foo
For removing a package including its configuration files
dpkg -l
For listing all the packages in the system’s package
database including all packages, installed and uninstalled
dpkg -l | grep apache2
For piping the output through grep to see a specific package
dpkg -L ufw
For listing the files installed by a package, in this case ufw is the package

2. Debian APT

Short for Advanced Package Tool, APT is an advanced interface to dpkg which provides the apt-get program. Moreover, APT tool merges the functionality of apt-get and apt-cache and also has a fancier coloured output format which makes it more pleasant for humans.

Below are mentioned a few basic commands to use APT.

Command Function
apt update
To update the list of packages known by your system
apt install foo
To install the foo package and all its dependencies
apt remove foo
To remove the foo package from your system
apt purge foo
To remove the foo package along with its configuration
files from your system
apt list --upgradable
To list all the packages for which newer versions are available
apt upgrade
To upgrade all the packages on your system without installing
extra packages or removing packages
apt full-upgrade
To upgrade all the packages on your system, and, if needed for a
package upgrade, installing extra packages or removing packages
apt search word
To find packages whose description contain word
apt show package
To print the detailed information of a package

3. Debian Aptitude

Firstly, Aptitude is another package manager for Debian GNU/Linux systems. Secondly moreover ,It provides a front-end to the apt package management infrastructure.

In Addition, Actions can be performed from a visual interface or from the command-line.Aptitude can be used to perform management tasks in a fast and easy way.

However, It provides the functionality of apt-get as well as many additional features such as easy access to all versions of a package.

In Addition, easy tracking of obsolete packages, powerful system for searching particular packages, limiting the package display, etc.

Using Aptitude for package management is relatively straightforward, and the user interface makes common tasks simple to perform.

However, Some examples of common package management functions as performed in Aptitude are installing packages, removing packages, updating packaging index, upgrading packages, etc.In Conclusion, The current state of the package is described using the following keys –

  • i: Installed package
  • c: Package not installed but package configuration remains on the system
  • p: Purged from system (Removed from the system including the configuration files)
  • v: Virtual Package
  • B: Broken package
  • u: Unpacked files but package not yet configured
  • C: Half-configured (Configuration failed and requires fix)
  • H: Half-installed (Removal failed and requires a fix)

In Addition, Aptitude can also be used as a command-line tool having very much similarity to APT package manager. You can always go to the man pages for more details about the usage and options.

4. Synaptic

Similarly, Synaptic is a graphical package management program for apt.In Addition, It provides the same features as the apt-get command line utility with a GUI front-end.

It enables you to install, upgrade and remove software packages in a user friendly way.In Addition, Along with most of the features offered by aptitude, some additional features are listed below:

  • Firstly, Installing, removing, upgrading and downgrading single and multiple packages
  • Secondly, Managing package repositories
  • Moreoever, Finding packages by name, description and several other attributes
  • In Addition, Sorting of packages by name, status, size or version
  • Browsing all available online documentation related to a package
  • Downloading the latest changelog of a package
  • Locking packages to the current version
  • Forcing the installation of a specific package version
  • Undoing and Redoing of selections
  • In Conclusion, Built-in terminal emulator for the package manage

5. Tasksel

Firstly, Performing a specific task might be difficult when you need to find the appropriate suite of packages that caters to your needs.

However, For this, tasks have been defined by the Debian developers which is simply just a collection of several individual Debian packages.All relating to a specific activity.

In Addition , these tasks can be installed through the Tasksel program or through aptitude.

Additionally , the installation of the tasks associated with a standard system and a desktop environment, is automatically done by the Debian installer.

Also, these tasks might be automatically installed in your system, depending on your selections throughout the installation process.

For example, if you selected a language other than English, the task associated with it will be installed automatically too and if the installer recognises you are installing on a laptop system the laptop task will also be installed.

Written by 

Riya is a DevOps Engineer with a passion for new technologies. She is a programmer by heart trying to learn something about everything. On a personal front, she loves traveling, listening to music, and binge-watching web series.