Install deb Files on Ubuntu: apt, dpkg, and gdebi

By 

Updated on

6 min read

Install deb packages on Ubuntu

When you download Linux software from a developer website, it may come as a .deb file instead of a package from the Ubuntu repositories. These files use the Debian package format and can be installed on Ubuntu with apt, dpkg, gdebi, or the graphical App Center.

For most local .deb files, apt is the recommended command-line method because it installs the package and resolves dependencies automatically.

Be careful when installing .deb packages from unofficial sources. A package can run scripts as root during installation, so download packages only from official project websites or trusted vendors.

This guide explains how to install deb files on Ubuntu, inspect them before installation, fix dependency errors, and remove packages later. The same commands also apply to Debian-based distributions such as Debian, Linux Mint, and elementary OS.

Quick Reference

TaskCommand
Install deb with aptsudo apt install ./package.deb
Install deb with gdebisudo gdebi package.deb
Install deb with dpkgsudo dpkg -i package.deb
Fix missing dependenciessudo apt install -f
Inspect deb file infodpkg -I package.deb
List deb file contentsdpkg -c package.deb
Remove a packagesudo apt remove package-name
Remove with config filessudo apt purge package-name
Clean unused dependenciessudo apt autoremove

Downloading deb Files

Some applications distribute their Linux packages as .deb files that you download directly from the project website. Google Chrome, Visual Studio Code, and TeamViewer are common examples.

The examples below use the TeamViewer deb file . If you prefer the terminal, you can download a deb file with wget or curl :

Terminal
wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
Terminal
curl -L -O https://download.teamviewer.com/download/linux/teamviewer_amd64.deb

Inspecting a deb File Before Installing

Before installing a deb package from a new source, inspect its metadata and contents.

To view package information such as the version, description, and dependencies:

Terminal
dpkg -I teamviewer_amd64.deb

To list all files that the package will install on your system:

Terminal
dpkg -c teamviewer_amd64.deb

Installing deb Files from the Command Line

The following sections cover the three common command-line methods: apt, gdebi, and dpkg. Use apt first unless you have a specific reason to use another tool.

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.

To install a local deb package with apt, provide the full path to the deb file. If the file is in your current working directory , prepend ./ before the package name. Otherwise, apt will try to retrieve and install the package from Ubuntu’s repositories.

Terminal
sudo apt install ./teamviewer_amd64.deb

You will be prompted to type Y to continue:

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]

The apt package manager resolves and installs the package dependencies.

Installing deb files with gdebi

gdebi is a small tool for installing local deb packages and their dependencies. It is not installed by default in Ubuntu, but you can install it with:

Terminal
sudo apt install gdebi

To install the deb package with gdebi:

Terminal
sudo gdebi teamviewer_amd64.deb
output
...
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.

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:

Terminal
sudo dpkg -i teamviewer_amd64.deb

Unlike apt and gdebi, dpkg does not resolve dependencies. If you get dependency errors when installing deb packages, run the following apt command to install the missing dependencies and finish configuring the package:

Terminal
sudo apt install -f

Removing a deb Package

To remove a package that was installed with apt or dpkg, use the package name (not the .deb filename):

Terminal
sudo apt remove teamviewer

To remove the package along with its configuration files:

Terminal
sudo apt purge teamviewer

If you installed the package with dpkg, you can also remove it with:

Terminal
sudo dpkg -r teamviewer

To clean up dependencies that are no longer needed after removing a package:

Terminal
sudo apt autoremove

Installing deb Packages Using a GUI

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

On current Ubuntu releases, the file opens in App Center. On older releases, it opens in Ubuntu Software or another graphical package installer.

Ubuntu App Center showing a deb package ready to install

Click the Install button and enter the administrative password when prompted.

Ubuntu authentication prompt for installing a deb package

The installation may take some time depending on the file size and its dependencies. Once the deb package is installed, the “Install” button will change to “Remove”.

Ubuntu App Center installing a deb package

Troubleshooting

apt says “Unable to locate package package.deb”
You probably omitted ./ before the filename. Run sudo apt install ./package.deb from the directory that contains the file, or provide the full path to the file.

dpkg reports dependency problems
dpkg installs only the package file and does not fetch missing dependencies. Run sudo apt install -f to install the required dependencies and finish configuring the package.

The App Center does not open the deb file
Use the command line instead. Open a terminal in the download directory and run sudo apt install ./package.deb.

apt remove cannot find the package
Use the installed package name, not the .deb filename. Run dpkg -l | grep keyword to find the package name, then remove it with sudo apt remove package-name.

The package source is not trusted
A deb package can run scripts as root during installation. Download packages only from official project websites or trusted vendors. When the project provides checksums or GPG signatures, verify them before installing.

FAQ

Which method should I use to install a deb file?
Use apt whenever possible. It installs the deb file and resolves dependencies automatically. Use dpkg only when you need low-level control over the installation.

Why does dpkg fail with dependency errors?
dpkg does not resolve dependencies. It installs only the package itself. Run sudo apt install -f after dpkg -i to install missing dependencies.

Is it safe to install deb packages from the internet?
Only install deb files from trusted sources such as official project websites. A deb package can run arbitrary scripts as root during installation. Verify checksums or GPG signatures when available.

Do these steps work on Debian and Linux Mint?
Yes. The same commands work on all Debian-based distributions, including Debian, Linux Mint, and elementary OS.

How do I find the package name to remove it?
Run dpkg -l | grep keyword to search for installed packages by name. The second column shows the package name to use with apt remove.

Conclusion

The recommended way to install local deb files on Ubuntu is with apt, as it resolves dependencies automatically. Use dpkg -I and dpkg -c to inspect a package before installing it, and use apt remove or apt purge when you need to uninstall it.

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page