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.
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:
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:
- Manual install of a DEB package using APT in the terminal.
- 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
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
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:
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:
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 File → Open and browse to the
atom.deb DEB package in your
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:
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
Next, request APT to remove package dependencies that were installed as well and that your system no longer needs:
sudo apt autoremove
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.
2 thoughts on “Manually install a DEB package on Debian or Ubuntu”
Comments are closed.