The three ways to install a .deb file on Ubuntu

A .deb file is a software package for Ubuntu and Debian-based systems. You can install one in three ways: using the graphical software manager (easiest), using the command line with dpkg (fastest), or using apt from the terminal (best for handling dependencies automatically). Which method you choose depends on whether you prefer clicking buttons or typing commands, and whether the package has other software it needs to work.

All three methods work on any Ubuntu version. The graphical method requires no terminal knowledge. The command-line methods are faster once you know the steps, and they give you more control over what gets installed.

Key Takeaways

  • The graphical method (right-click the .deb file and select "Open With Software Install") works on any Ubuntu desktop without opening a terminal.
  • The dpkg command installs the file directly but will fail if the package needs other software that is not already on your system.
  • The apt command automatically finds and installs any other packages your software needs, making it the most reliable terminal method.
  • You need the full file path or the file location to be your current directory before any terminal command will work.
  • If installation fails, check that the .deb file matches your Ubuntu version (32-bit or 64-bit) and that you have permission to install software.

Using the graphical software manager (no terminal needed)

Open your file manager and navigate to the folder where your .deb file is saved. Right-click the .deb file and look for an option called "Open With" or "Open With Software Install". Click that option. A window will open showing the package name, version, and what it will do. Click the "Install" button. Ubuntu will ask for your password — type it and press Enter. The software will install and the window will close when finished.

This method works on Ubuntu 20.04 and later with the default GNOME desktop. If you do not see an "Open With Software Install" option, your system may use a different software manager. In that case, try the apt method below instead.

Installing with dpkg from the terminal

Open a terminal. Navigate to the folder where your .deb file is saved by typing cd /path/to/folder and pressing Enter. Replace /path/to/folder with the actual path — for example, cd ~/Downloads if the file is in your Downloads folder. Then type sudo dpkg -i filename.deb, replace filename.deb with the actual file name, and press Enter. Type your password when prompted.

The dpkg method works immediately if the package has no dependencies — that is, if it does not need other software to run. If it does have dependencies and they are not installed, dpkg will show an error message listing what is missing. In that case, use the apt method instead, which finds and installs those dependencies automatically.

Installing with apt (recommended for the terminal)

Open a terminal and navigate to the folder containing your .deb file using cd /path/to/folder. Then type sudo apt install ./filename.deb and press Enter. Note the ./ before the file name — this tells apt to install from your current folder. Type your password when prompted. Ubuntu will show you what else it needs to install, ask you to confirm, and then download and install everything.

The apt method is more reliable than dpkg because it automatically finds and installs any other packages your software depends on. It also checks that the versions are compatible with your system. Use this method if dpkg failed with a dependency error, or if you want the safest installation.

Finding the file path if you are not sure

If you do not know the full path to your .deb file, right-click it in the file manager and look for "Properties" or "Get Info". A window will open showing the file location. Copy the path shown there. In the terminal, type cd (with a space after it), then paste the path, and press Enter.

Alternatively, you can drag the .deb file from the file manager into the terminal window. The terminal will automatically type the full path for you. Then type the rest of the command after it.

What to do if installation fails

If you see an error message, check three things. First, make sure the .deb file is for your Ubuntu version — a 32-bit package will not install on a 64-bit system, and vice versa. You can check your system type by opening a terminal and typing uname -m. If it shows x86_64, you have 64-bit; if it shows i686, you have 32-bit.

Second, if the error mentions missing dependencies, use the apt method instead of dpkg. Third, if you see a permission error, make sure you typed sudo at the start of the command. If none of these fixes work, search the package name plus "Ubuntu" to see if there is a known issue or an alternative version you should use instead.

Removing a .deb package you installed

To uninstall software you installed from a .deb file, open a terminal and type sudo apt remove package-name, replacing package-name with the name of the software. You can find the package name by typing sudo dpkg -l | grep keyword, replacing keyword with part of the software name you remember. Press Enter and look through the list.

Using apt remove instead of dpkg -r is safer because it also removes any packages that were installed only to satisfy dependencies, if nothing else needs them.

Frequently Asked Questions

Can I install a .deb file from a USB drive or external disk?

Yes. Plug in the USB drive or external disk, open the file manager, navigate to it, and either double-click the .deb file or use the terminal method with the path to the file on that drive. The installation works the same way.

What is the difference between dpkg and apt?

dpkg installs only the file you give it and fails if other packages are missing. apt finds and installs those missing packages automatically. For most users, apt is simpler and more reliable.

Do I need to be connected to the internet to install a .deb file?

Not for the file itself, but apt needs internet to download any dependencies. If you use dpkg and the package has no dependencies, you do not need internet. Check your connection before you start if you are using apt.

Why does the graphical method not work on my system?

Some Ubuntu versions or desktop environments use different software managers. If right-clicking does not show an install option, use the apt terminal method instead — it works on all Ubuntu systems.

Can I install a .deb file meant for Debian on Ubuntu?

Usually yes, because Ubuntu is based on Debian. However, the package might depend on a specific version of Debian or Ubuntu that you do not have. If installation fails, the package may not be compatible with your version.