How to Install Deb Files (Packages) on Ubuntu

Updated 

4 min read

Deb is the installation package format used by all Debian based distributions.

The Ubuntu repositories contain thousands of deb packages that can be installed either from the Ubuntu Software Center or from the command line with the apt and apt-get utilities.

Many applications are not included in the Ubuntu or any 3rd party repositories. Those applications have to be downloaded from the developer’s websites and installed manually. Be extra careful when installing deb packages from unofficial sources.

In this tutorial, we will explain how to install deb files on Ubuntu 18.04. The same instructions apply for Ubuntu 16.04 and any Debian based distribution, including Debian, Linux Mint and Elementary OS.

Downloading deb Files

For the purposes of demonstration, in this tutorial, we will download and install the TeamViewer deb file. TeamViewer, is an all-in-one solution for remote support, desktop sharing, online meetings, and file transfer between computers.

Launch your web browser and navigate to the TeamViewer for Linux download page. Download the deb package by clicking on the Ubuntu and Debian download link.

If you prefer the terminal, you can download the deb file with wget or curl:

wget --no-check-certificate https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
curl -k -O -L https://download.teamviewer.com/download/linux/teamviewer_amd64.deb

Installing deb Files from the Command Line

When it comes to installing deb packages from the command line you have several tools at your disposal. In the following sections, we will show you how to use apt, gdebi and dpkg utilities to install deb packages.

Installing deb files with apt

apt is a command-line utility for installing, updating, removing and otherwise managing deb packages on Ubuntu, Debian, and related Linux distributions. It was introduced in Ubuntu 14.04 and combines the most commonly used commands from apt-get and apt-cache.

To install local deb packages with apt you need to provide the full path to the deb file. If the file is located in your current working directory instead of typing the absolute path you can prepend ./ before the package name. Otherwise apt will try to retrieve and install the package from Ubuntu’s repositories.

sudo apt install ./teamviewer_amd64.deb

You will be prompted to type Y to continue:

...
0 upgraded, 84 newly installed, 0 to remove and 64 not upgraded.
Need to get 21.0 MB of archives.
After this operation, 66.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

The apt package manager will resolve and install all the package dependencies.

Installing deb files with gdebi

gdebi is a tool for installing local deb packages. It is not installed by default in Ubuntu, but you can install it with the following command:

sudo apt install gdebi

To install the deb package with gdebi type:

sudo gdebi teamviewer_amd64.deb
...
Do you want to install the software package? [y/N]:

Type y when prompted and gdebi will resolve and install the deb package and all its dependencies for you.

Installing deb files with dpkg

dpkg is a low-level package manager for Debian-based systems. Use the -i (or --install) option to install deb packages with dpkg.

sudo dpkg -i teamviewer_amd64.deb

Unlike apt and gdebi, dpkg doesn’t resolve dependencies. If you get any dependency errors when installing deb packages you can use the following apt command to resolve and install all package dependencies:

sudo apt install -f

Installing deb Packages using GUI

If you prefer to use a graphical interface, simply download the deb file and open it with a double click.

This will open the default distro Graphical Software Center

Click on the Install button and the Authenticate dialog box will open.

Enter the administrative password and click on the Authenticate button.

The installation may take some time depending on the file size and its dependencies. Once the deb package is installed the Install button within the Ubuntu Software Center will change to Remove.

That’s all, the application has been installed on your system and you can start using it.

Conclusion

We have shown you how to install local deb files in Ubuntu.

Feel free to leave a comment if you have any questions.