Introduction
Before we begin talking about how to install Deb Files on Ubuntu, let's briefly understand – What are Deb Files?
All Debian-based distributions use the Deb installation package format.
The Ubuntu repositories contain thousands of deb packages that may be installed from the Ubuntu Software Center or from the command line using the apt
and apt-get
commands.
Many applications are not available through Ubuntu or third-party repositories. These applications need to be manually installed after being downloaded from the developers' websites. When installing deb packages from unauthorized sources, proceed cautiously.
We will demonstrate how to install deb files on Ubuntu 20.04 in this tutorial. The same guidelines are applicable for Ubuntu 16.04 as well as all Debian-based operating systems, such as Debian, Linux Mint, and Elementary OS.
Downloading deb Files
We will download and install the TeamViewer deb file for demonstration purposes. TeamViewer is a one-stop shop for remote support, desktop sharing, online meetings, and file transfer between computers.
Go to the TeamViewer for Linux download page in your web browser. By clicking the Ubuntu and Debian download link, you can download the deb package.
If you prefer the terminal, use wget
or curl
to download the deb file:
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
You have a number of tools at your disposal when it comes to installing deb packages from the command line. You will learn how to install deb packages using the apt
, gdebi
, and dpkg
utilities in the following sections.
Installing deb files with apt
On Ubuntu, Debian, and related Linux distributions, apt
is a command-line utility for installing, updating, removing, and managing deb packages in general. It was first made available in Ubuntu 14.04 and combines the most popular apt-get
and apt-cache
commands.
You must specify the entire path to the deb file in order to install local deb packages using apt
. You can prefix ./
before the package name if the file is present in your current working directory, rather than providing the absolute path. Otherwise, apt
will attempt to retrieve and install the package from Ubuntu's repositories.
sudo apt install ./teamviewer_amd64.deb
To proceed, you will be asked to type Y
:
Output
...
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]
All package dependencies will be resolved and installed by the apt
package manager.
Installing deb files with gdebi
A tool for installing local deb packages is called gdebi
. It is not by default installed on Ubuntu, but you may install it with the following command:
sudo apt install gdebi
To install the deb package using gdebi
, follow these steps:
sudo gdebi teamviewer_amd64.deb
Output
...
Do you want to install the software package? [y/N]:
When prompted, press y
to have gdebi
resolve the deb package and all of its dependencies for you.
Installing deb files with dpkg
Debian-based systems use dpkg
, a low-level package manager. To install deb packages using dpkg
, use the -i
(or --install
) option.
sudo apt install ./teamviewer_amd64.deb
dpkg
, unlike apt
and gdebi
, does not resolve dependencies. When installing deb packages, if you encounter any dependency issues, you can use the apt
command to resolve and install all package dependencies:
sudo apt install -f
Installing deb Packages using GUI
If you prefer a graphical interface, simply download the deb file and double-click it to launch it.
This launches the default distro Graphical Software Center:
When you click the Install button, the Authenticate dialog box opens.
After providing the administrative password, press the Authenticate button.
Depending on the size of the file and its dependencies, installation could take some time. The “Install” button in the Ubuntu Software Center will change to “Remove” once the deb package has been installed.
That's it! The application is now installed on your machine and ready for use.
Conclusion
You now know how to install local deb files on Ubuntu. Use apt
to resolve and install all package dependencies when installing packages from the command line.
If you have any queries, feel free to drop a comment below, and we'll be happy to help.