Feature image for the article about how to manually install a DEB package on Debian or Ubuntu

Manually install a DEB package on Debian or Ubuntu

Sometimes you want to install software that is not readily available in the Debian or Ubuntu online software repository. Luckily, a lot of third party software providers make a DEB package available for you to install. This article explains how you can manually install software bundled as a DEB package onto your Debian system. Since Ubuntu derives from Debian, the explanation applies to Ubuntu based systems as well.

Background

What actually is a DEB package? A DEB package is a file format that specifies how to bundle and install software on the Debian Linux distribution. Since the Ubuntu Linux distribution derives from Debian, it supports DEB packages for software installations as well.

If you used either Debian or Ubuntu before, you undoubtedly worked with DEB packages already. You just might not have noticed it. All software that these Linux distributions support and maintain are essentially DEB packages. So whenever you install software with APT, under the hood it installs the software from the DEB package. An example for installing the HTOP interactive processes viewer:

sudo apt install htop

In this case APT downloads the HTOP DEB package for your PC’s architecture, from the Debian software repository, and installs it on your system. Theoretically you can download the HTOP DEB package yourself and install it manually. You can find the link to the DEB package of HTOP at the bottom of this page on the Debian website. You can even find a link on the same page for viewing the files inside the DEB package, including their installation destination:

Browser screenshot that shows the file list of the HTOP DEB package from the online Debian repository.

When should you manually install a DEB package?

The Debian online software repository already includes HTOP. For this reason it doesn’t really make sense to manually download and install this DEB package. Just extra work that APT automates for you.

However, situations do exists where you need to install a DEB package manually on your system. When? Basically every time you want to install software or a software version that is not (yet) included in your distribution’s online software repository. Luckily, a lot of third party software providers make a DEB package available for you to install. If not, then you might have to create the DEB package yourself. However, that is outside the scope of this article. I will probably cover the creation of DEB packages sometime in the future though.

This article explains how you can manually install software bundled as a DEB package onto your Debian system. Two different ways of manually installing a DEB package will be presented:

  1. Manual install of a DEB package using APT in the terminal.
  2. Manual install of a DEB package using the GDebi graphical user interface program.

As mentioned before, Ubuntu derives from Debian. Therefore the explanation applies to Ubuntu based systems as well.

What do you need

To complete the presented instructions, all you need is a Debian or Ubuntu based system. It doesn’t really matter in what format. It can be:

  • A laptop or desktop PC.
  • A VirtualBox virtual machine.
  • A Raspberry PI with the Raspberry PI operating system installed.
  • A home or cloud server.

For this article, I decided on using a VirtualBox virtual machine running Ubuntu Budgie 20.04 “focal”. The virtual machine runs on my laptop, which has Debian 10 “buster” installed with the Gnome desktop environment.

For testing purposes, we’ll manually install the DEB package of the Atom editor. Atom is an easy-to-use programmer’s editor. A large eco-system exists around it, with all sorts of extra plugins and themes for you to install. Although the Atom editor misses from the Debian and Ubuntu online software repositories, they do offer a DEB package for download on their website. With other words, the perfect candidate for this article.

Download the Atom editor DEB package

Let’s get started by downloading the Atom editor’s DEB package. You can either visit the website of the Atom editor. The home page shows the download link for the DEB package. Alternatively, you can paste the following command in the terminal:

wget -O ~/Downloads/atom.deb https://atom.io/download/deb

This stores the atom.deb DEB package in the Downloads directory of your user’s home directory. Going forward with the manual install of the Atom editor DEB package, I assume that you downloaded the atom.deb DEB package to your ~/Downloads directory.

Terminal screenshot of downloading the Atom editor DEB package with WGET.

Manually install a DEB package

I’ll demonstrate two different methods for manually installing a DEB package. First by calling APT directly in the terminal. Then by running the GDebi program for those that prefer a graphical user interface.

Install a DEB package with APT

In the introduction I already mentioned how you usually install a DEB package from the Debian or Ubuntu online software repository:

sudo apt install [PACKAGE NAME]

You can use a similar syntax for manually installing a DEB package from a file:

sudo apt install -f [PACKAGE FILE]

Instead of specifying the package name, you simply specify the location of the DEB package. Additionally you add the -f command line option. This results in APT automatically installing software packages that the DEB package depends on.

Let’s give this a try for installing the Atom editor. Run the following command to manually install the Atom editor DEB package and its dependencies:

sudo apt install -f ~/Downloads/atom.deb

Terminal screenshot that shows how to manually install the Atom editor DEB package with APT.

Once the installation completes, you can find the Atom editor in your desktop environment’s application menu and start it. After starting it for the first time, it looks like this:

Screenshot that shows what the Atom editor looks like, when you run it for the first time.

Install a DEB package with GDebi

GDebi offer a graphical user interface for the manual install of DEB packages. To install it, simply run the following command from the terminal:

sudo apt install gdebi

Alternatively, you can install GDebi using your desktop environments software installer. For example Gnome Software:

Screenshot that shows how to install the GDebi program using the Gnome Software application.

Once you installed GDebi, you can find it in your desktop environment’s application menu to start it. In the program menu, you can select FileOpen and browse to the atom.deb DEB package in your ~/Downloads directory:

GDebi screenshot that shows how to open a DEB package.

This loads the DEB package for installation. It automatically determines the package dependencies that should be installed as well. To proceed with the installation of the Atom editor’s DEB package, click the Install Package button on the top right side:

GDebi screenshot that shows how to manually install the Atom editor DEB package.

When the installation finishes, you can find the Atom editor in your desktop environment’s application menu and start it.

Manually remove a DEB package

Removing the manually installed DEB package is the same as for any other package. First remove the package itself with this command:

sudo apt remove atom

Terminal screenshot that shows how to remove a previously installed DEB package with APT.

Next, request APT to remove package dependencies that were installed as well and that your system no longer needs:

sudo apt autoremove

Terminal screenshot that shows how to run the APT autoremove command for removing package dependencies that are no longer needed on your system.

Wrap up

This article taught you how to manually install a DEB package on Debian or Ubuntu. For testing purposes we used the DEB package of the Atom editor.

You can use APT, assuming that you are comfortable working from the terminal. The command syntax is:

sudo apt install -f [PACKAGE FILE]

Note the importance of the -f command line parameter. You need it to have APT automatically install package dependencies for you.

Alternatively, you can use the GDebi software program, in case you prefer a program with a graphical user interface.

You can also use APT to remove the package and its dependencies from your system. It is a two step process. First remove the actual package and then its dependencies. APT automatically figures out which dependencies it no longer needs:

sudo apt remove [PACKAGE NAME]

sudo apt autoremove

Personally, I highly recommend getting comfortable with working from the terminal on Linux. It might strike you as inconvenient at first, but the Linux terminal offers so many powerful tools. Things such as grep, find, awk, sed and many more. As a first practice you can go through the article that teaches you how to edit text files from the terminal with Nano.

PragmaticLinux

Long term Linux enthusiast, open source software developer and technical writer.

View all posts by PragmaticLinux →