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

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
| Task | Command |
|---|---|
| Install deb with apt | sudo apt install ./package.deb |
| Install deb with gdebi | sudo gdebi package.deb |
| Install deb with dpkg | sudo dpkg -i package.deb |
| Fix missing dependencies | sudo apt install -f |
| Inspect deb file info | dpkg -I package.deb |
| List deb file contents | dpkg -c package.deb |
| Remove a package | sudo apt remove package-name |
| Remove with config files | sudo apt purge package-name |
| Clean unused dependencies | sudo 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
:
wget https://download.teamviewer.com/download/linux/teamviewer_amd64.debcurl -L -O https://download.teamviewer.com/download/linux/teamviewer_amd64.debInspecting 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:
dpkg -I teamviewer_amd64.debTo list all files that the package will install on your system:
dpkg -c teamviewer_amd64.debInstalling 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.
sudo apt install ./teamviewer_amd64.debYou 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 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:
sudo apt install gdebiTo install the deb package with gdebi:
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.
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.debUnlike 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:
sudo apt install -fRemoving a deb Package
To remove a package that was installed with apt or dpkg, use the package name (not the .deb filename):
sudo apt remove teamviewerTo remove the package along with its configuration files:
sudo apt purge teamviewerIf you installed the package with dpkg, you can also remove it with:
sudo dpkg -r teamviewerTo clean up dependencies that are no longer needed after removing a package:
sudo apt autoremoveInstalling 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.

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

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”.

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 problemsdpkg 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 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