How to Install a .deb File on Debian

Install a deb file on Debian with sudo apt install ./package.deb, fix dependencies with apt install -f after dpkg -i, use gdebi, inspect packages with dpkg-deb, and troubleshoot wrong path, conflicts, and architecture errors.

Published

Updated

Read time 7 min read

Reviewed byDeepak Prasad

Install deb file on Debian hero with DEBIAN GUIDE badge, package manager graphics, and local deb install highlights

A .deb file is a Debian binary package—vendor apps like Google Chrome and Valve Steam distribute them when software is not in Debian’s main archives. Installing one is not the same as running apt install packagename from a mirror: you point apt or dpkg at a file on disk and let the package manager pull dependencies from your existing sources.

This guide covers install a deb file on Debian for Debian 11 (Bullseye), 12 (Bookworm), and 13 (Trixie): the recommended apt install ./file.deb path, dpkg -i with apt install -f, gdebi, GUI installers, inspection with dpkg-deb, verification, uninstall, and the errors that drive most forum threads (wrong directory, missing ./, dependency failures, conflicts, wrong architecture). I ran the commands on Debian 13 with a real curl package downloaded via apt download.

Tested on: Debian 13 (trixie); kernel 6.12.94+deb13-amd64; amd64.

IMPORTANT
Install .deb files only from vendors you trust. Random “Chrome”, “Zoom”, or “driver” downloads from third-party mirrors are a common malware path—prefer official sites (dl.google.com, repo.steampowered.com, etc.).

Choose an install method

Method Best for Resolves dependencies?
sudo apt install ./file.deb Default for everyone (recommended) Yes—automatically
sudo dpkg -i + sudo apt install -f Minimal systems, automation, legacy scripts After -f
gdebi Desktop users who want a GUI or gdebi CLI Yes
File manager / Software One-off GUI install on GNOME or KDE Usually yes (via apt backend)
Inspect only Audit before install N/A

Use sudo apt install ./package.deb unless you have a reason to call dpkg directly.


Prerequisites

  • Debian 11, 12, or 13 matching the architecture printed on the .deb (amd64, arm64, etc.).
  • sudo or root—installing packages changes system files under /usr and /etc.
  • Working apt mirrors in /etc/apt/sources.list or sources.list.d/ so dependencies can download.
  • The .deb file on disk—download with curl or wget, or copy from another machine.

Check your architecture:

bash
. /etc/os-release && echo "$PRETTY_NAME"
dpkg --print-architecture
text
Debian GNU/Linux 13 (trixie)
amd64

Inspect the deb before installing

Read control metadata without installing:

bash
cd /tmp
apt download curl
dpkg-deb -f curl_*.deb Package Version Architecture Maintainer
text
Get:1 http://deb.debian.org/debian trixie/main amd64 curl amd64 8.14.1-2+deb13u3 [270 kB]
Fetched 270 kB in 0s (549 kB/s)
Package: curl
Version: 8.14.1-2+deb13u3
Architecture: amd64
Maintainer: Debian Curl Maintainers <[email protected]>

Full control file:

bash
dpkg-deb -I curl_8.14.1-2+deb13u3_amd64.deb | head -20
text
Package: curl
 Version: 8.14.1-2+deb13u3
 Architecture: amd64
 Depends: libc6 (>= 2.34), libcurl4t64 (= 8.14.1-2+deb13u3), zlib1g (>= 1:1.1.4)
 Description: command line tool for transferring data with URL syntax

List files the package will place on disk:

bash
dpkg-deb -c curl_8.14.1-2+deb13u3_amd64.deb | head -8
text
drwxr-xr-x root/root         0 ./usr/
drwxr-xr-x root/root         0 ./usr/bin/
-rwxr-xr-x root/root    321880 ./usr/bin/curl
-rwxr-xr-x root/root     11241 ./usr/bin/wcurl

For a large vendor package:

bash
dpkg-deb -f google-chrome-stable_current_amd64.deb Package Version Architecture
text
Package: google-chrome-stable
Version: 149.0.7827.200-1
Architecture: amd64

If Architecture does not match dpkg --print-architecture, do not force-install the .deb.


APT treats a local file like a package source when you prefix the filename with ./:

bash
cd /tmp
sudo apt install ./curl_8.14.1-2+deb13u3_amd64.deb

apt installs curl and pulls libcurl4t64 and other Depends from Debian mirrors automatically.

Verify:

bash
curl --version | head -1
dpkg -l curl
text
curl 8.14.1 (x86_64-pc-linux-gnu) libcurl/8.14.1 OpenSSL/3.5.6 ...
ii  curl  8.14.1-2+deb13u3  amd64  command line tool for transferring data with URL syntax

The ./ prefix matters

Without ./, apt searches repositories for a package name:

bash
apt install curl_8.14.1-2+deb13u3_amd64.deb
text
Error: Unable to locate package curl_8.14.1-2+deb13u3_amd64.deb

Use sudo apt install ./filename.deb, not sudo apt install filename.deb. The same mistake appears when tutorials say apt-get install GP6.deb without ./dpkg or apt install ./ is correct.

Use an absolute path from any directory

bash
sudo apt install /tmp/curl_8.14.1-2+deb13u3_amd64.deb

That avoids the classic cannot access archive error from running dpkg -i package.deb in the wrong folder.


Install with dpkg, then fix dependencies

Low-level install—unpack first, resolve dependencies second:

bash
cd /tmp
sudo dpkg -i curl_8.14.1-2+deb13u3_amd64.deb

If dependencies were already satisfied, setup completes immediately:

text
Selecting previously unselected package curl.
Preparing to unpack curl_8.14.1-2+deb13u3_amd64.deb ...
Unpacking curl (8.14.1-2+deb13u3) ...
Setting up curl (8.14.1-2+deb13u3) ...

When dpkg -i stops with unmet dependencies, finish with:

bash
sudo apt install -f

The -f flag tells apt to fix broken dependency state by installing missing packages from your configured mirrors (Debian FAQ — package tools).

Wrong path errors look like:

bash
sudo dpkg -i ~/Downloads/fake.deb
text
dpkg: error: cannot access archive '/root/Downloads/fake.deb': No such file or directory

Run find ~ -name '*.deb' or ls ~/Downloads/ to confirm the filename, then cd to that directory or pass the full path.


Install with gdebi (GUI or CLI)

gdebi installs a local .deb and resolves dependencies through apt—similar to apt install ./ with a dedicated front-end:

bash
sudo apt install -y gdebi

GUI: open the .deb in the file manager → Open WithGDebi Package Installer.

CLI (non-interactive):

bash
sudo gdebi -n /path/to/package.deb

On minimal servers without a desktop, apt install ./file.deb is simpler and does not require extra packages.


Install from the desktop (GNOME / KDE)

On desktop Debian:

  1. Download the .deb (for example into ~/Downloads).
  2. Double-click the file, or right-click → Open WithSoftware Install / Discover.
  3. Authenticate when prompted and confirm Install.

Some GNOME Software versions reject certain third-party .deb files with “file type not supported”—use gdebi or the apt install ./ terminal method instead.


Real-world examples on Debian

Software .deb source Install command
Google Chrome dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome-stable_current_amd64.deb
Steam (Valve) repo.steampowered.com/steam/archive/steam_latest.deb sudo apt install ./steam_latest.deb
Debian package offline apt download packagename sudo apt install ./packagename_*.deb

Many vendor .deb files also drop /etc/apt/sources.list.d/*.list or *.sources so future updates use sudo apt upgrade—check with list installed packages on Debian after install.


Upgrade, reinstall, or downgrade

Reinstall the same version:

bash
sudo apt install --reinstall ./curl_8.14.1-2+deb13u3_amd64.deb

Upgrade when a newer .deb replaces an older one:

bash
sudo apt install ./newer-version.deb

Downgrading usually requires explicit version pinning—avoid unless you understand apt pinning.


Uninstall a package installed from a deb

Find the package name:

bash
dpkg-deb -f package.deb Package

After install:

bash
sudo apt purge packagename

Example:

bash
sudo apt purge google-chrome-stable

Remove vendor repository files if you no longer want apt to track that source:

bash
sudo rm -f /etc/apt/sources.list.d/google-chrome.sources
sudo apt update

Troubleshooting

Symptom Likely cause Fix
cannot access archive '…deb': No such file or directory Wrong working directory or typo ls the folder; use full path or cd first
Unable to locate package foo.deb Missing ./ with apt sudo apt install ./foo.deb
E: Invalid operation / treating .deb as apt subcommand Wrong syntax Use apt install, not apt foo.deb alone
dependency problems prevent configuration dpkg -i without deps sudo apt install -f
package architecture (arm64) does not match system (amd64) Wrong .deb arch Download the build for dpkg --print-architecture
conflicts with / Breaks: Incompatible with installed package Remove conflicting package or pick a .deb built for your suite
held broken packages Mixed suites or pinned versions apt-mark showhold; align sources to one Debian release
Could not get lock /var/lib/dpkg/lock Another apt/dpkg running Wait; close other installers; never delete lock files casually
dpkg-deb: error: 'file.deb' is not a Debian format archive Corrupt download or wrong file Re-download; verify with file package.deb
Permission denied on /var/lib/dpkg Missing sudo Prefix with sudo
Installed but command not found Wrong package or PATH dpkg -L packagename; check command -v
Vendor apt update GPG errors after install Missing or rotated signing key Reinstall vendor .deb or import documented key (Chrome guide)

References


Summary

Install a deb file on Debian with sudo apt install ./package.deb—the ./ tells apt to use the local file and install dependencies from your mirrors. For the dpkg -i workflow, run sudo apt install -f when unmet dependency errors appear. Inspect packages first with dpkg-deb -I and dpkg-deb -f, match architecture to your system, and purge with sudo apt purge packagename when you remove vendor software.


Frequently Asked Questions

1. What is the best way to install a deb file on Debian?

Run sudo apt install ./package.deb from the directory that contains the file. The ./ prefix tells apt to use the local file and automatically install dependencies from your configured Debian mirrors.

2. What is the difference between apt install ./file.deb and dpkg -i file.deb?

apt install ./file.deb resolves and installs dependencies from repositories in one step. dpkg -i only unpacks the deb—you often need sudo apt install -f afterward to pull missing dependencies.

3. Why does dpkg say cannot access archive?

You are not in the directory where the deb lives, or the path is wrong. Use cd ~/Downloads first, pass the full path sudo dpkg -i /home/user/Downloads/package.deb, or use sudo apt install ./package.deb with ./ in front of the filename.

4. Why does apt say Unable to locate package foo_amd64.deb?

You omitted the ./ prefix. apt install package.deb searches repositories for a package name, not a local file. Use sudo apt install ./package.deb instead.

5. How do I fix unmet dependencies after installing a deb?

Run sudo apt install -f. apt reads dpkg state and installs missing Depends packages from your mirrors. If versions conflict, the deb may be built for a different Debian release or architecture.

6. Can I install a deb file without the command line on Debian?

Yes. GNOME Software, KDE Discover, or gdebi can open a downloaded deb from the file manager. For servers and scripts, apt install ./file.deb remains the standard approach.

7. How do I check what is inside a deb before installing?

Run dpkg-deb -I package.deb for control metadata, dpkg-deb -f package.deb Package Version Architecture for quick fields, and dpkg-deb -c package.deb to list files. Download Debian packages with apt download packagename for a local copy.

8. How do I uninstall a package installed from a deb file?

Use sudo apt purge packagename—the same as repository packages. Find the name with dpkg-deb -f package.deb Package before install or dpkg -l after install. Remove vendor apt sources in /etc/apt/sources.list.d/ if the deb added them.
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on …