A file that has the .DEB file extension is a Debian software package file. They contain software to be installed on Debian or a Debian-based operating system. Ubuntu falls into that category, being based on Debian and capable of executing .DEB files.
In this article, we’ll go over the steps to install a DEB file on Ubuntu 20.04 Focal Fossa and talk about some best practices along the way.
In this tutorial you will learn:
- DEB file security and searching Ubuntu’s package repository
- How to intall DEB files with dpkg
- How to install DEB files with gdebi
- How to install DEB files via GUI
|Category||Requirements, Conventions or Software Version Used|
|System||Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
A word of warning
Before you jump into installing a DEB file on your system, realize that installing software from third party sources can have a negative impact on the stability and security of your Ubuntu system. Only install DEB files if you’re confident about the source of the file and can verify its integrity.
One of the awesome things about Ubuntu and other flavors of Linux is that they have a myriad of stable, tested, and secure software available in their software repositories, only a short download away. Before installing a DEB file, you should check Ubuntu’s repository first to see if the software is already available from there.
To search Ubuntu’s package repository for a package, open a terminal and type the following command:
$ apt search SOME-KEYWORD
If you see the desired package within the output returned from
apt, take note of the package’s name and install it with this command:
$ sudo apt install PACKAGE-NAME
Install DEB file using dpkg
dpkg command is the first method we’ll go over for installing DEB packages and is also probably the most common. Run the command like this, while replacing
example.deb with the name of your package:
$ sudo dpkg -i example.deb
If the package requires dependencies that aren’t already on your system, you’ll see this error in the terminal:
dpkg: error processing package
Don’t fret, because we can install the required dependencies with a single command, assuming that they are available in Ubuntu’s package repository. Just run this command to install the dependencies:
$ sudo apt install -f
Install DEB file using gdebi
gdebi command to install DEB packages is even better than
dpkg because it will automatically download and install any required dependencies, while of course installing the DEB file itself.
gdebi command may not be available on your system by default, so you’ll have to install the
gdebi-core package in order to access it. Use this command to install
$ sudo apt install gdebi-core
Now that the
gdebi command is available, use it to install your package by executing this command:
$ sudo gdebi example.deb
gdebi will prompt you to ask whether or not to install the file, just enter
y for ‘yes’ and allow the installation proceed.
Install DEB file via GUI
If you prefer to use the GUI instead of command line, this section is for you. Follow these steps to install a DEB file on your Ubuntu system via GUI:
- Right click on the DEB file you wish to install and select
Open With Software Install.
- The next window will give you a little information about what you’re installing. Click the
Installbutton to continue.
- Installing software always requires administrator privileges. Enter your password to proceed with the installation.
- The DEB file is now installed on your system. As you can see, the
Installbutton has been replaced with a
Removebutton, which you can use later in case you need to uninstall the software.
In this article, we learned how to install DEB file packages on Ubuntu 20.04 Focal Fossa. We covered two different command line options for the installation, as well as a GUI alternative.
We also learned of the potential dangers that lie with DEB files, and how to search Ubuntu’s repository as a preferred installation source. Now that you know how to install DEB files, stay safe by only installing them from sources you trust.