Debian

How to Install Packages on Debian 12

how to install packages on debian 12

In Debian, software usually comes in packages (compressed archive) such as .deb, .tar.gz, .rpm, etc., whenever it is to be compiled from the source. These packages are then extracted in order to install them. Package Managers are used to install, update, or uninstall packages. In this article, we will describe how to install packages using different package managers on the Debian 12 (Bookworm) distribution.

How to Install Packages on Debian 12?

There are a number of ways to install a package on Debian 12 systems. We are going to discuss installing a package using the following five packet managers:

  • APT (Advanced Packaging Tool) Package Manager
  • DPKG Package Manager
  • RPM Package Manager
  • Aptitude Package Manager
  • GDEBI Package Manager

Method 1: Using APT (Advanced Packaging Tool) Package Manager

APT is the default package management tool in Debian. It is a high-level package management system. It automatically checks and downloads all dependencies. For example, if we would like to install Google Chrome, we will run the following command:

$ sudo apt install ./google-chrome-stable_current_amd64.deb

Method 2: Using DPKG Package Manager

DPKG delivers low-level package management as compared to apt, i.e., it does not check dependencies and does not install required other packages. For example, if we would like to install Google Chrome, we will download the file first from Google Chrome’s website and run the following command to install Google Chrome:

$ sudo dpkg -i google-chrome-stable_current_amd64.deb

Method 3: Using RPM Package Manager

RPM packages are used by Red Hat-based Linux distributions such as Fedora and CentOS. RPM package manager doesn’t work on Debian-based systems, but there are two ways using which we can install .rpm packages.

RPM packages can be installed directly by using the Alien tool which provides support for RPM packages by running the following command:

$ sudo apt install alien -y

We can then use the Alien tool to install Google Chrome by running the following command:

$ sudo alien -i google-chrome-stable_current_x86_64.rpm

Optional: Convert .rpm to .deb package

An alternative method is to convert the .rpm package into a .deb package by using Alien Tool and then by installing the .deb package by using the dpkg package manager by running the following set of commands:

$ sudo alien google-chrome-stable_current_x86_64.rpm

As seen from the above screenshot, the .rpm package is converted into the .deb package.

We will now install the .deb file by running the following command:

$ sudo dpkg -i google-chrome-stable_116.0.5845.96-2_amd64.deb

Method 4: Using Aptitude Package Manager

Aptitude is similar to apt command. The difference between apt and aptitude is that aptitude is not available on Debian systems by default. We can install aptitude by running the following command:

$ sudo apt install aptitude

Press Y at the prompt to continue with the installation process:

From the screenshot, it can be seen that aptitude is installed.

Verify Installation

We can verify aptitude installation by checking the version by running the following command:

$ man aptitude

Installing VLC Media Player

VLC Media player will be installed using the following command.

$ sudo aptitude install vlc

Launch VLC

VLC media player can be launched by pressing the Activities button in the left corner of the screen, then by typing “vlc’’ in the search bar and by selecting the VLC icon.

Method 5: Using the GDEBI Package Manager

Gdebi is one of the most reliable package installers in Linux distributions. It installs local packages in order to resolve the dependencies of the package. Gdebi is not pre-installed in Debian, so we have to install it. It can be installed by the following command:

$ sudo apt install gdebi

For example, if we would like to install Sublime Text 4, we will run the following command:

$ sudo gdebi sublime-text_build-4152_amd64.deb

That is all from the guide.

Conclusion

To install packages on Debian 12, users can use the apt dpkg, rpm, aptitude, and gdebi package managers, along with the installation of a package. Apart from these package managers, there are some specific package managers, for example, PIP (Python Install Packages) for Python packages, and NPM (Node Packet Manager) for JavaScript.

Similar Posts