Website Vidya
Linux & ServersStep-by-Step Guide

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.

RR
Rajesh RayLead Systems Educator
Published:
6 min read
PDF Cheat Sheet
Install deb Files on Ubuntu: apt, dpkg, and gdebi
AI Executive SummaryWebsiteVidya AI

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.

Key Highlights
  • Prerequisites and Supported Releases
  • Step 1: Understanding .deb Packages and Dependencies
  • Step 2: Method 1: Installing .deb Files Using APT (Recommended)
Grounded in full engineering runbookWebsiteVidya AI Engine

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.

Advertisement

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 sudo administrative privileges.
  • A downloaded .deb package 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.

Advertisement

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.

Advertisement

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.

Deepen your Linux system administration skills with our related production-tested guides:

Authoritative References and Official Documentation

Frequently Asked Questions

Quick answers to common questions and configurations

4 FAQs
Without ./ 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.
Only if the package installs a repository configuration into /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.
Yes. Run sudo apt install ./*.deb inside the folder containing your deb packages to install all of them in a single dependency-resolved operation.
RR
Written byVerified Author

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.

SPAM-FREE MODERATED DISCOURSE

Join the Conversation & Perspective

Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.

AT
MP
JV
+2

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Featured Infrastructure PartnerUp to 75% OFF + 3 Months Free

Supercharge Your Linux & Cloud Workloads with Hostinger

Deploy high-speed NVMe KVM VPS, Docker containers, and LiteSpeed-accelerated WordPress servers in under 60 seconds with full root access, dedicated IPv4, and 24/7 technical support.

Pure NVMe SSD StorageFull Root Access & SSHFree Domain & Unlimited SSL99.9% Uptime SLA
Plans from$2.99/mo
Claim Hostinger DealAffiliate link • Special discount applied at checkout