Skip to main content
๐Ÿ›ก๏ธ Verified Technical Content: Written by Serhii Hrekov. | Last reviewed & updated in Git: May 10, 2026

How to Install a .deb Package on Ubuntu

ยท 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Ubuntu, like other Debian-based systems, uses .deb files as the standard package format. While most software is installed via apt or the Ubuntu Software Center, sometimes you may need to install software manually using a .deb file you downloaded from a website or built yourself.

In this article, we'll cover how to install .deb packages using the GUI and command line, how to resolve dependencies, and best practices for safe installation.


1. What Is a .deb Package?โ€‹

A .deb file is a Debian Software Package. It includes all the files, metadata, and scripts necessary to install and manage software on Debian-based systems like Ubuntu.


2. Installing via the GUI (Ubuntu Software)โ€‹

If you're using Ubuntu Desktop:

  1. Double-click the .deb file.
  2. Ubuntu Software will open and show an Install button.
  3. Click Install and enter your password.

โœ… Best for beginners and simple apps โš ๏ธ Sometimes fails if dependencies are missing


3. Installing via dpkg (Low-Level CLI Tool)โ€‹

dpkg is a low-level tool that directly installs .deb packages without checking for missing dependencies.

sudo dpkg -i ./example-package.deb

To fix missing dependencies after this step:

sudo apt-get install -f

Great for scripted installs Will fail if dependencies are missing (until you run apt install -f)


The apt tool can install local .deb packages and resolve dependencies automatically.

sudo apt install ./example-package.deb

Note: You must include ./ or an absolute path; otherwise, apt will look in remote repos. โœ… Safest and most reliable method โœ… Automatically resolves and installs dependencies


Checking If a Package Is Installedโ€‹

To verify installation:

dpkg -l | grep package-name
To check which files were installed:

dpkg -L package-name

Uninstalling a .deb Packageโ€‹

To remove a package:

sudo apt remove package-name
To purge configuration files too:

sudo apt purge package-name

Common Errors and Fixesโ€‹

โŒ dpkg: error processing package (...)
Run:

sudo apt install -f
โŒ Unable to locate package ./example.deb
Make sure to include ./ in the file path.

โŒ Dependency is not satisfiable: libxyz
Either install the required dependency manually or use apt which handles it automatically.

Automating .deb Installation (Optional)โ€‹

For scripts or Dockerfiles:

curl -O <https://example.com/package.deb>
sudo apt install ./package.deb -y
Or using gdebi (optional tool for advanced handling):

sudo apt install gdebi
sudo gdebi ./example-package.deb


When Not to Use .deb Filesโ€‹

If the package is already in Ubuntu's apt repositories If the .deb file is from an untrusted source If the package offers a Snap, Flatpak, or AppImage alternative that updates automatically

  1. Summary
MethodDependency HandlingRecommended For
GUIโŒBeginners
dpkgโŒ (manual fix)Advanced scripting
aptโœ…Most users
gdebiโœ… (optional)Desktop + GUI fallback

Further Readingโ€‹

Need to automate .deb installs across machines or deploy in CI/CD pipelines? Consider wrapping your install steps with apt and verifying checksum signatures for safety.