Install deb Files on Ubuntu: apt, dpkg, and gdebi
Learn how to install deb files on ubuntu using apt, dpkg, and gdebi, resolve missing dependencies, inspect package contents, and remove packages cleanly.

6 min read
Learn how to install deb files on ubuntu using apt, dpkg, and gdebi, resolve missing dependencies, inspect package contents, and remove packages cleanly.
- Prerequisites and Supported Releases
- Step 1: Understanding .deb Packages and Dependencies
- Step 2: Method 1: Installing .deb Files Using APT (Recommended)
On Debian and Ubuntu Linux distributions, software is bundled and distributed using compiled archive packages bearing the .deb file extension.
While the majority of applications are installed directly from network repositories via apt install, many popular commercial and developer tools—including Google Chrome, Visual Studio Code, Zoom, and Slack—are distributed as standalone downloadable .deb installer packages.
Installing local .deb files requires knowing which tool to use and how to handle dependent libraries that might not be packaged within the archive.
In this guide, we examine how to install deb files on ubuntu using three distinct terminal methods (apt, dpkg, and gdebi) and explain how to resolve broken dependencies and safely remove installed software.
Complete step-by-step developer and system administrator tutorial on how to install local Debian binary packages (.deb files) on Ubuntu 24.04 LTS and 22.04 LTS. Explains the difference between apt, dpkg, and gdebi package installers, resolving broken dependencies with apt --fix-broken install, viewing package metadata, listing installed file contents, and cleanly removing packages from your system.
Prerequisites and Supported Releases
This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat) & Ubuntu 22.04 LTS. The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.
Before proceeding, ensure you have the following requirements satisfied:
- A computer or virtual server running Ubuntu 24.04 LTS or Ubuntu 22.04 LTS.
- A non-root user account with
sudoadministrative privileges. - A downloaded
.debpackage file saved to your local filesystem.
Step 1: Understanding .deb Packages and Dependencies
A .deb file is an ar archive containing two primary tarballs: one with the application binaries and configuration files, and another with control metadata and maintainer scripts.
The control metadata specifies the exact library dependencies required for the program to function properly on your system.
If your system lacks these required shared libraries, attempting to run the software will result in dependency errors.
Choosing the right tool to install your .deb file determines whether missing dependencies are downloaded and resolved automatically or flagged as errors.
Step 2: Method 1: Installing .deb Files Using APT (Recommended)
The most reliable and recommended method for installing local .deb files is using the modern apt command.
Unlike legacy utilities, apt automatically identifies missing dependent packages listed in the .deb control file, fetches them from official Ubuntu repositories, and installs everything together in a single transaction.
To install a local file with apt, you must provide a relative or absolute path (beginning with ./ or /) so APT treats it as a local file rather than a remote repository package:
# Download an example .deb package (Google Chrome):
cd ~/Downloads
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# Install the local package using apt (note the ./ prefix):
sudo apt install ./google-chrome-stable_current_amd64.deb
# Verify installed package:
google-chrome --version
# Expected output confirms: Google Chrome 124.x or newer
Step 3: Method 2: Installing .deb Files with dpkg
dpkg is the low-level Debian package manager operating beneath APT.
While dpkg excels at unpacking and registering packages directly, it has one major limitation: it does not have network access and cannot download missing dependencies automatically.
If a package has unmet dependencies, dpkg -i fails with a dependency error.
You can resolve the unconfigured dependencies immediately afterward using apt --fix-broken install:
# Attempt installation using dpkg:
sudo dpkg -i package_name.deb
# If dpkg reports unmet dependencies (errors were encountered):
# Run apt fix-broken to download and configure missing dependencies automatically:
sudo apt --fix-broken install -y
# Once dependencies are installed, APT completes the package configuration.
Step 4: Method 3: Installing .deb Files with Gdebi
gdebi is a lightweight, dedicated command-line and graphical package installer specifically engineered for local .deb files.
Like APT, gdebi inspects the local file, checks for dependencies, and downloads them from repositories automatically.
Install gdebi-core using APT, then use it to install your package:
# Install gdebi command-line tool:
sudo apt update
sudo apt install -y gdebi-core
# Install deb package with automatic dependency resolution:
sudo gdebi google-chrome-stable_current_amd64.deb
Step 5: Inspecting Package Details Before Installation
Before installing unknown third-party software, it is good administrative practice to inspect the package's metadata, architecture, and contained files.
Use dpkg -I (info) to read the package control description and dependencies:
Use dpkg -c (contents) to list all files and destinations packed inside the archive:
# View package architecture, dependencies, and maintainer info:
dpkg -I google-chrome-stable_current_amd64.deb
# List all files and directories inside the package:
dpkg -c google-chrome-stable_current_amd64.deb | head -n 25
Step 6: Uninstalling deb Packages from Ubuntu
Once installed, a .deb package integrates into the system package registry.
To remove it later, reference the internal package name (not the .deb filename) using standard APT commands:
Use apt remove to delete the application binaries while keeping configurations, or apt purge to remove configuration files completely:
# Find the exact registered package name:
dpkg -S $(which google-chrome)
# Output: google-chrome-stable: /usr/bin/google-chrome
# Remove application binaries:
sudo apt remove google-chrome-stable
# Or purge binaries and global configuration files:
sudo apt purge google-chrome-stable
# Clean up unused dependency packages:
sudo apt autoremove -y
Troubleshooting and Common Errors
When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:
dpkg: dependency problems prevent configuration of package ...
Cause: The package requires libraries that are not currently installed on the host operating system.
Resolution: Run sudo apt --fix-broken install to download and install the missing dependencies automatically.
sudo apt --fix-broken install
E: Unsupported file ./package.deb given on command line
Cause: The command was run with apt-get instead of modern apt, or the file path is invalid.
Resolution: Use sudo apt install ./package.deb with the explicit ./ relative path notation.
sudo apt install ./package.deb
dpkg: error: package architecture (amd64) does not match system (arm64)
Cause: You downloaded a package compiled for x86_64 CPU architecture on an ARM64 system (such as Raspberry Pi or Apple Silicon VM).
Resolution: Download the ARM64 compatible .deb build of the application.
dpkg --print-architecture
Security Best Practices and Hardening
Only install .deb files obtained from trusted, verified vendor websites; malicious deb packages can execute arbitrary root scripts during installation.
Verify checksum hashes (SHA-256) of downloaded deb packages against the publisher's published security values before installing.
Check if an official APT repository exists for the software so you receive automated security updates rather than manually downloading new deb files.
Related Ubuntu Tutorials and Documentation
Deepen your Linux system administration skills with our related production-tested guides:
- How to Use dpkg Command to Install and Manage Debian Packages — Comprehensive guide to querying, extracting, and configuring packages with dpkg.
- How to Fix APT and dpkg Lock Errors on Ubuntu and Debian — Resolve
/var/lib/dpkg/lock-frontendand apt lock contention safely. apt vs apt-get: The Difference and When to Use Each— Compare high-level modern APT tools with classic scripts.
Authoritative References and Official Documentation

The Linux Command Line, 2nd Edition: A Complete Introduction
Frequently Asked Questions
Quick answers to common questions and configurations
./ or an absolute path (/path/to/file.deb), APT assumes the argument is the name of a remote package from your configured repositories rather than a local file on disk./etc/apt/sources.list.d/ during its setup (as Google Chrome does). Otherwise, you must download and install newer deb files manually.apt remove deletes application binaries and libraries while leaving user configuration files intact. apt purge removes the application binaries as well as all system-level configuration files.sudo apt install ./*.deb inside the folder containing your deb packages to install all of them in a single dependency-resolved operation.Editorial Disclosure: Website Vidya is supported by our readers. When you purchase hosting, tools, or software through our verified partner links, we may earn an affiliate commission at no extra cost to you. We only recommend solutions we trust and rigorously verify.
Rajesh Ray
I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.
Most Read Guides
TrendingUbuntu Server Not Booting? 10 Simple Steps to Fix It Fast
How to Create a 3D Button in HTML and CSS: Easy Steps
How to Install Python and Pip on Ubuntu 24.04 LTS
How to Install Nginx on Ubuntu 24.04
How to Install Python on Ubuntu 24.04 LTS
Related Technical Guides
Tested runbooks, server administration walkthroughs, and troubleshooting guides


Join the Conversation & Perspective
Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.
No comments on this guide yet. Be the first to share your thoughts or ask a question!