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
For a printable quick reference, see the apt and dpkg cheatsheets.
| 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 |
| Repair broken dependencies (may remove packages) | 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 for 64-bit Intel and AMD systems. Check your system architecture before downloading:
dpkg --print-architectureUse the commands below if the result is amd64. If it is arm64 or another value, download a package built for that architecture and replace the filename in the commands throughout this guide.
If you prefer the terminal, you can download the deb file with wget
:
wget https://download.teamviewer.com/download/linux/teamviewer_amd64.debTo download it with curl
, add -L to follow the redirect to the current version:
curl -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.debOn recent Ubuntu releases, you will see a summary like the illustrative output below. Package counts and sizes vary with the release, architecture, and packages already installed. Review the proposed changes, then type Y to continue:
Note, selecting 'teamviewer' instead of './teamviewer_amd64.deb'
...
Summary:
Upgrading: 0, Installing: 9, Removing: 0, Not Upgrading: 23
Download size: 116 kB / 111 MB
Space needed: 392 MB / 23.5 GB available
Continue? [Y/n]The Note, selecting line shows the package name stored inside the file, teamviewer. You will use this name, not the filename, when you remove the package.
The apt package manager resolves and installs the package dependencies.
This multi-line summary first shipped in Ubuntu 24.10 with apt 2.9.8 and continues in apt 3. Ubuntu 24.04 LTS and earlier print the older upgraded, newly installed summary lines and ask Do you want to continue? [Y/n] instead.
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. The gdebi-core package provides the command-line version, while the gdebi package adds the graphical frontend and its GTK dependencies:
sudo apt install gdebi-coreTo 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 repair broken dependencies. Review the proposed changes before confirming: if the required dependencies are unavailable, apt may remove the unconfigured package instead of completing its installation.
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. Review the package details, click Install, and enter your administrative password when prompted. On older releases, the file may open in Ubuntu Software or another graphical package installer.
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.
apt prints “Download is performed unsandboxed as root”
This notice alone does not mean the installation failed. It appears when permissions prevent the unprivileged _apt user from reading the local deb file or accessing a parent directory, so apt reads the file as root instead. To avoid the notice, place the file in an accessible directory such as /tmp and make sure the file is readable by _apt, for example with permissions 0644. Moving the file alone preserves its existing permissions.
dpkg reports dependency problemsdpkg installs only the package file and does not fetch missing dependencies. It leaves the package unconfigured and prints dependency problems prevent configuration of teamviewer:. Run sudo apt install -f to repair broken dependencies, and review the proposed changes before confirming. If the required dependencies are unavailable, apt may remove the unconfigured package. For further help, see our guide on fixing broken packages on Ubuntu
.
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 repair broken dependencies. Review the proposed changes before confirming, because apt may remove the unconfigured package if its dependencies are unavailable.
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 1000+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.
View author page