What a .deb file is and why you might install one directly

A .deb file is Ubuntu's native package format — a single file that contains a program, its settings, and instructions for where everything goes on your system. Most of the time you install software through Ubuntu's built-in app store or the command line, which pulls packages from official repositories. But sometimes you need to install a .deb file directly: a vendor provides it for their proprietary software, a program isn't in the official repositories yet, or you've downloaded it from a developer's website.

Installing a .deb directly bypasses the repository system, which means you're responsible for checking that the file comes from a source you trust. Ubuntu won't automatically update it when new versions come out, and if the package has unmet dependencies — other software it needs to run — you'll have to track those down yourself. That said, the process is straightforward and works the same way every time.

Key Takeaways

  • The graphical method (double-clicking the .deb file) works on most Ubuntu systems and is the safest choice if you're unsure which method to use.
  • The command-line method using sudo apt install ./filename.deb is faster and shows you exactly what will be installed before you confirm.
  • The dpkg command is the lowest-level tool but requires you to manually install any missing dependencies afterward.
  • Always verify the .deb file comes from a trusted source before installing, since packages run with system-level permissions.

Method 1: Double-click the file in your file manager

This is the simplest method and works on any Ubuntu desktop system. Navigate to the folder where you downloaded the .deb file using Files (the folder icon on your taskbar). Right-click the .deb file and select "Open With" — you should see an option for "Software" or "Ubuntu Software Center." Click it, and a window will open showing you the package name, version, and size.

Click the "Install" button. Ubuntu will prompt you for your password (because installing software requires administrator permission), and the installation will begin. You'll see a progress bar, and when it finishes, the button will change to "Remove," confirming the package is now installed. You can close the window and start using the program — it will appear in your applications menu or launcher.

If the installation fails with a message about unmet dependencies, this method won't show you which packages are missing. Switch to Method 2 instead, which will tell you exactly what's needed.

Method 2: Use apt install from the terminal (recommended)

Open a terminal by pressing Ctrl+Alt+T or searching for "Terminal" in your applications menu. Navigate to the folder containing the .deb file using the cd command. For example, if the file is in your Downloads folder, type:

cd ~/Downloads

Then run this command, replacing filename.deb with the actual name of your file:

sudo apt install ./filename.deb

Ubuntu will show you a list of what it's about to install, including any dependencies it needs to download from the repositories. Review this list — it should show the package you want plus any supporting libraries. Type y and press Enter to proceed. The installation will download and install everything, and you'll see a confirmation when it's done.

This method is faster than the graphical approach and gives you full visibility into what's being installed. If dependencies are missing and can't be found in the repositories, apt will tell you which ones before installing anything, so you can stop and investigate.

Method 3: Use dpkg for direct installation

The dpkg command is the lowest-level package manager — it installs the .deb file itself but doesn't automatically fetch dependencies from repositories. Open a terminal and navigate to the folder with your .deb file, then run:

sudo dpkg -i filename.deb

The package will install, but if it has unmet dependencies, dpkg will report them and the program may not work until you install those dependencies manually. You'd then need to run:

sudo apt install -f

This tells apt to "fix" the broken dependencies by installing whatever is missing. Use this method only if you understand what dependencies are or if you're troubleshooting a specific installation problem. For most users, Method 2 is simpler because it handles dependencies automatically.

What to do if the installation fails

The most common failure is unmet dependencies — the .deb file needs other packages that aren't installed yet. If you used Method 1, switch to Method 2, which will show you exactly what's missing. If you used Method 3 and see a dependency error, run sudo apt install -f to fetch and install them.

If apt can't find a dependency in the repositories, the package may be too old for your Ubuntu version or designed for a different system. Check the vendor's website or documentation to see if they provide a newer version or installation instructions specific to your Ubuntu release.

If the installation succeeds but the program won't start, the .deb file itself may be corrupted or incompatible with your system. Download it again from the source and verify the file size or checksum if the vendor provides one — this confirms the download wasn't interrupted or tampered with.

Keeping your system secure when installing .deb files

Because .deb packages run with system-level permissions, only install them from sources you trust. Vendor websites, official GitHub releases, and well-known open-source projects are generally safe. Avoid downloading .deb files from random forums or untrusted websites.

If you're uncertain about a source, search for the package name plus "Ubuntu repository" — if it's available in the official repositories, install it through apt instead. This way, Ubuntu will keep it updated automatically and you avoid the security risk of installing from an unknown source.

You can also check what a .deb file contains before installing it by running dpkg -c filename.deb in the terminal. This shows you every file the package will place on your system, which helps you spot anything suspicious.

Uninstalling a .deb package

Removing a package you installed from a .deb file works the same way as removing any other package. Open a terminal and run:

sudo apt remove package-name

Replace package-name with the actual name of the package (not the filename). If you're not sure of the exact name, run apt list --installed | grep keyword, replacing keyword with part of the program's name. This will show you all installed packages matching that keyword, and you can identify the one you want to remove.

If you want to remove the package and clean up its configuration files, use sudo apt purge package-name instead. This is useful if you plan to reinstall the program later and want a fresh start.

Frequently Asked Questions

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

Yes. Plug in the drive, navigate to it in Files, and double-click the .deb file, or open a terminal, navigate to the drive using cd /media/username/drive-name, and run the apt or dpkg command. The installation process is identical.

What's the difference between installing from a .deb file and using apt?

When you install from a .deb file, you're installing a specific version that won't update automatically. When you install through apt from the repositories, Ubuntu manages updates for you. For software you plan to keep long-term, the repository version is usually better.

Will installing a .deb file break my system?

A .deb file from a trusted source won't break your system. The worst that typically happens is the installation fails due to missing dependencies, and you can uninstall it immediately. Ubuntu's package system is designed to prevent conflicts.

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

Usually yes — Ubuntu is based on Debian, and most .deb files work on both. However, if the package is very old or designed for a specific Debian version, it may have compatibility issues. Try installing it and see if it works; if not, uninstall it and look for an Ubuntu-specific version.

How do I know if a .deb file is safe to install?

Check that it comes from an official vendor website, a well-known open-source project with a GitHub repository, or a trusted software distributor. Avoid files from unknown forums or file-sharing sites. If you're still unsure, you can inspect the file contents with dpkg -c filename.deb before installing.