Debian Ubuntu

How to Install DEB Packages on Ubuntu

The package files of Ubuntu have the extension .deb and it’s also called DEB files. On Ubuntu, there are many ways to install a DEB package file.  In this article, I am going to show you how to install DEB packages on Ubuntu using different package managers. So, let’s get started.

Installing DEB packages with DPKG:

dpkg is a package manager for Debian and all the Debian based operating systems such as Ubuntu, Linux Mint etc. dpkg can install packages from DEB files. But there is a problem. dpkg won’t resolve the package dependencies automatically. You will have to manually download each DEB files and install it in order. But there is a solution to this problem which we will see in this section.

Let’s say, you want to install the DEB package file filezilla_3.28.0-1_amd64.deb which is in the ~/Downloads directory.

To install the DEB package with DPKG, run the dpkg command as follows:

$ sudo dpkg -i ~/Downloads/filezilla_3.28.0-1_amd64.deb

As you can see, DPKG can’t resolve package dependencies automatically. So, the package installation failed. If the package did not depend on any other packages, then the installation would’ve been successful.

Now, to resolve the dependency problems, run the following command:

$ sudo apt -f install

As you can see, the dependency packages are marked for installation as these are available in the official package repository of Ubuntu. Now, to confirm the installation, press y and then press <Enter>.

The package should be installed correctly along with all the dependencies.

Installing DEB Packages with APT Package Manager:

You can install DEB package files with the APT package manager. APT package manager is a very popular package manager on Ubuntu/Debian operating system.

The advantage of installing a DEB package file with the APT package manager is that the APT package manager automatically downloads and installs all the required dependency packages for you. This is obviously a better way to install a DEB package than using the DPKG package managaer.

Let’s say, you want to install FileZilla using the DEB package file filezilla_3.28.0-1_amd64.deb. To do that with the APT package manager, run the following command:

$ sudo apt install ./Downloads/filezilla_3.28.0-1_amd64.deb

As you can see, the APT package manager automatically determines what other packages are required to successfully install the DEB package file filezilla_3.28.0-1_amd64.deb. Now, to confirm the installation, press y and then press <Enter> to continue.

As you can see, the filezilla_3.28.0-1_amd64.deb DEB package file is installed.

Installing DEB Packages with Ubuntu Software Center:

If you’re using an Ubuntu desktop operating system, then you can easily install DEB package files using Ubuntu Software Center. Like the APT package manager, Ubuntu Software Center will also download and install all the required dependency packages automatically.

For example, let’s say, you want to install Visual Studio Code programming text editor on your Ubuntu Desktop operating system. You have to download a DEB package file of Visual Studio Code from the official website of Visual Studio Code https://code.visualstudio.com.

Now, to install the DEB package file using Ubuntu Software Center, first navigate to the directory where you saved the Visual Studio Code DEB package file.

Now, right click on the Visual Studio Code DEB package file and click on Open With Software Install.

Once the Ubuntu Software Center is opened, click on the Install button as marked in the screenshot below.

Now, type in the password of your login user and click on Authenticate.

As you can see, the Visual Studio Code is being installed.

At this point, the DEB package should be installed.

Installing DEB Packages with GDebi Package Manager:

You can also use the GDebi package manager to install DEB packages on Ubuntu. The GDebi package manager also downloads and installs all the required dependency packages automatically.

The GDebi package manager is not installed by default on Ubuntu. But, it is available in the official package repository of Ubuntu. You can easily install it using the APT package manager.

First, update the APT package repository cache with the following command:

$ sudo apt update

Now, run the following command to install the GDebi package manager on your Ubuntu machine.

$ sudo apt install gdebi -y

GDebi package manager should be installed. Now, you can install DEB packages with GDebi package manager.

Let’s say, you want to install the filezilla_3.28.0-1_amd64.deb DEB package with GDebi package manager. To do that, run the following command:

$ sudo gdebi ./Downloads/filezilla_3.28.0-1_amd64.deb

Now, to confirm, press y and then press <Enter>.

filezilla_3.28.0-1_amd64.deb DEB package should be installed along with all the dependency packages.

So, these are the ways to install DEB packages on Ubuntu. Thanks for reading this article.

About the author

Shahriar Shovon

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.