Curious Minds

Clear answers to science and history questions

How to Run a DEB File on Linux: Step-by-Step

· 6 min read · Science

To run a .deb file, you install it with a package manager such as dpkg or apt, which unpacks the archive and places its files in the correct system locations. On Debian, Ubuntu, Linux Mint and related distributions, the simplest command is sudo apt install ./filename.deb. You can also double-click the file in a graphical file manager to open it in a software installer. The file itself is not executed like a program; it is a package that must be installed first.

What You'll Need

  • A Debian-based Linux distribution (Debian, Ubuntu, Linux Mint, Pop!_OS, Kali, Raspberry Pi OS and similar).
  • The .deb file saved somewhere you can find it, such as your Downloads folder.
  • Administrator rights (sudo access) to install system-wide.
  • A terminal application, or a graphical package installer if you prefer clicking.
  • An internet connection if the package has dependencies that are not already installed.

Step-by-Step

  1. Confirm the file type. Open a terminal and run file package.deb. It should report “Debian binary package”. If it reports something else, you have the wrong file.
  2. Check your distribution. Run cat /etc/os-release. If the output shows Debian, Ubuntu or a derivative, .deb is the right format. On Fedora, openSUSE or Arch, use the native package format instead.
  3. Navigate to the file. Use cd ~/Downloads (or wherever the file is) so you can refer to it by name.
  4. Inspect the package before installing. Run dpkg-deb -I package.deb to see the package name, version, architecture and dependencies. Check that the architecture matches your system (dpkg --print-architecture), for example amd64 or arm64.
  5. Install with apt (recommended). Run sudo apt install ./package.deb. The leading ./ tells apt this is a local file path, not a repository package name. apt installs the package and pulls in any missing dependencies automatically.
  6. Alternatively, install with dpkg. Run sudo dpkg -i package.deb. This installs the package but does not resolve dependencies. If it reports missing dependencies, follow up with sudo apt install -f to fix them.
  7. Enter your password when prompted. sudo asks for your user password. Nothing appears on screen as you type; press Enter when done.
  8. Verify the installation. Run dpkg -l | grep package-name or apt list --installed | grep package-name. You should see the package listed with its version.
  9. Launch the program. Many packages add a menu entry, so look in your application launcher. From a terminal, run the program name (often the package name without the version). If you do not know the command, run dpkg -L package-name to list installed files and look for executables under /usr/bin.
  10. Remove the .deb file if you no longer need it. Once installed, the original file is not required. Keep it if you want to reinstall later without downloading again.

Common Mistakes

  • Running the file directly. Typing ./package.deb or double-clicking and choosing “Run” does not install it. Use a package manager or a software installer.
  • Forgetting the leading ./ with apt. sudo apt install package.deb makes apt look for a repository package named “package.deb” and fails. Use ./package.deb.
  • Using dpkg on a package with unmet dependencies. dpkg leaves the package half-configured. Always follow with sudo apt install -f.
  • Installing the wrong architecture. A package built for amd64 will not install on an arm64 system, and vice versa. Check with dpkg --print-architecture.
  • Mixing distributions. A .deb built for one release may depend on library versions that another release does not have. Prefer packages built for your distribution version.
  • Ignoring warnings about untrusted packages. A .deb from an unknown source can contain anything the installer can run as root. Only install packages you trust.

Tips

  • Prefer the version of a program in your distribution's repositories when one exists; it receives security updates through the normal system updater.
  • Keep downloaded .deb files in a dedicated folder so you can reinstall or roll back later.
  • Use apt show ./package.deb to read the description and dependencies before installing.
  • If a newer version of the same package is already installed, apt may refuse to downgrade. Remove the installed version first with sudo apt remove package-name, then install the .deb.
  • For a graphical route, right-click the file in your file manager and choose “Open with” your software installer (often called Software Install, GDebi or similar).
  • Record the package name before installing so you can remove it later with sudo apt remove package-name.

Troubleshooting

  • “dpkg: dependency problems prevent configuration”. Run sudo apt install -f. If that fails, the required dependency may not be available for your release; check the package's documentation.
  • “package architecture (amd64) does not match system (arm64)”. You downloaded the wrong build. Get the package for your system's architecture.
  • “Sub-process /usr/bin/dpkg returned an error code (1)”. The package's post-installation script failed. Read the lines above the error for the actual cause. You can try sudo dpkg --configure -a to finish configuring pending packages.
  • “The following packages have unmet dependencies”. apt cannot find a package that the .deb requires. Enable the repositories your distribution expects, update with sudo apt update, and try again.
  • Installation succeeds but no program appears. The package may be a library or a plugin rather than an application. List its files with dpkg -L package-name to see what it installed.
  • The installer opens but the Install button is greyed out. You may lack administrator rights, or a conflicting version is already installed. Try the terminal method to see the exact error.
  • A half-installed package blocks other installs. Run sudo dpkg --configure -a, then sudo apt install -f. If the package is broken beyond repair, remove it with sudo dpkg --remove package-name.

Frequently Asked Questions

Can I run a .deb file without installing it?

Not directly. A .deb is an archive, not a program. You can extract its contents with dpkg-deb -x package.deb folder and inspect the files, but running them from the extracted folder often fails because the program expects files in system locations. Installation is the normal route.

What is the difference between dpkg and apt for .deb files?

dpkg is the low-level tool that unpacks and installs the package. apt is a higher-level tool that calls dpkg and also resolves dependencies from repositories. For a local .deb, sudo apt install ./file.deb is usually the smoother choice.

Do .deb files work on Fedora or Arch Linux?

No. Fedora and its relatives use RPM packages, and Arch uses its own package format. Converting a .deb to another format is possible with third-party tools but is not officially supported and can produce a broken install.

How do I uninstall a program installed from a .deb file?

Use the package name, not the file name: sudo apt remove package-name. To also delete configuration files, use sudo apt purge package-name. Find the package name with dpkg -l | grep followed by part of the program name.

Why does apt say “Unable to locate package” when I give a .deb file?

apt interprets a bare name as a repository package. Prefix the file with ./ or give its full path, for example sudo apt install ./downloads/program.deb.

Is it safe to install any .deb file?

Only if you trust its source. Installation scripts run with administrator rights, so a malicious package can modify the system. Prefer packages from your distribution's repositories or from the software's official site.

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions