For Linux users, software can come from many sources. There's PPAs, software stores, the Snap store, Flathub, and more. You won't find every app you want in one of those, however; you may have to visit an application vendor's website to download and install file with a .deb extension. But how do you install a deb file?

In this article we'll explore what a deb file is and how you can install or uninstall one through several different methods, both on the desktop and in the terminal. We'll also explore how to update them and how you can install them on a BSD operating system.

What Is a Deb File?

Deb files (short for Debian) are archive files that contain not just the necessary files for an application program, but also scripts for installation and configuration of the app you want to install. If you're coming from Windows, deb files are similar in that way to .exe files.

Do you need to be a Linux expert to install a deb file?

Absolutely not. In fact, as we'll see below, there are many easy ways to install a deb package on Ubuntu and other Debian-based distributions.

Related: 8 Sites for Downloading DEB or RPM Linux Apps

One important note is that applications installed with deb files often require that additional packages, called dependencies, be installed along with them in order to work. While all of the methods explored today will install your deb file, not all of them will install the dependencies, and we'll make note when that's the case.

Software Center​

Most Linux distros will include some kind of software center app. Ubuntu's is called Ubuntu Software Center, and in Mint it's called Software Manager. These apps give you an attractive package browsing and installation experience.

Using one of them to install a deb file is simple. Typically, if you double-click on the deb file in your file browser, it will launch the installation with your software center.

Installing Deb File in Ubuntu Software Install

If it opens with an archive manager instead, right-click the file and select the software center from the list of usable applications.

This method is not recommended, however, because software center apps won't make sure the deb file's dependencies get installed. Some of the later methods in this list are better built for that purpose.

To uninstall an app with the software center, you'll need to look for a list of installed apps.

Viewing Installed Packages in Software Manager

Clicking on a package listed there will give you the option to uninstall it.

Gdebi​

Gdebi is a small application designed specifically for unpacking deb files with a simple GUI interface. It also checks for the file's dependencies and alerts you when Gdebi will be installing them.

Gdebi often comes pre-installed on Ubuntu-based distros. But if you don't have it for some reason, you can quickly install it with this command:

        sudo apt install gdebi
    

With gdebi installed, just right-click on the deb file and select Open with Gdebi.

Installing Discord with Gdebi

The gdebi dialog will tell you if dependencies are going to be installed with it and list which ones. Click the Install button to install the package along with its dependencies.

To remove it again, simply open the original deb file with gdebi again and click Uninstall.

Dpkg

​To install a deb file in the terminal, open the directory containing your deb file, and activate dpkg with this command:

        sudo dpkg -i filename.deb
    
Installing Discord Deb File with Dpkg

Similar to the software center, dpkg will not install dependencies that might be missing. Instead, it may leave the application in an "unconfigured" state (as shown in the picture above) and you won't be able to use it.

If you get such an error, you can fix it with this apt command:

        sudo apt-get install -f
    

The -f flag tells it to fix broken dependencies for currently installed packages.

To remove a deb package with dpkg, use this command:

        sudo dpkg -r packagename
    
Uninstalling Discord with Dpkg

The -r flag tells dpkg to simply remove the application. If you want to clear out other files as well, use --purge instead.​

You'll need to know the package name, which is sometimes different than the file name. As you'll read below, apt can help you find out the package name if you're not sure.

Apt

​If you've used Linux for long at all, you've likely issued apt commands to install packages from an Ubuntu software repository.

Apt, however, will also install a local deb file, and it will do so with a higher likelihood of success than dpkg. Apt, in fact, uses dpkg under the hood to perform the installation, but it also checks for dependencies.

You'll need to direct apt to the file's location in order to perform the install. Open the file's directory in the terminal and issue this command:

        sudo apt install ./filename.deb
    
Installing Discord Deb File with Apt

To uninstall a package with apt, you don't need to know the location---just the package name. In our example, the filename was discord-0.0.13.deb, but the package name was "discord."

If you're not sure what the package name is, you can perform a search in apt with this command, replacing <searchterm> with your guess:

        sudo apt list --installed | grep <searchterm>
    

It will list every package with your search term in it. Once you've found the package name, issue this command:

        sudo apt remove <package>
    

This command will remove the package itself, but not any of its stored files. If you want to get rid of every trace of the package, issue this command:

        sudo apt purge <package>
    

How to Update Deb Packages

​Any application in active development will at least occasionally issue updates. So how do you update a deb package?

It depends on the vendor. Some apps, like Chrome and Discord, will perform an automatic install and will probably notify you when it's happening.

Related: How to Stop Automatic Chrome Updates in Windows

Many others, however, require you to download and install a new file every time a new version is released. To be certain, check the application vendor's website for details.

How to Install Deb Files on FreeNAS BSD

​Deb files are native to Debian-based systems, not BSD. Most of the same applications, however, are available through BSD's own package management system.

If you want to try installing a deb file on a BSD operating system like FreeNAS or OpenBSD anyway, it is usually possible. You'll just need to find a BSD port of dpkg or apt and follow the instructions above.

Install Your Favorite Applications

We talked about the many simple ways you can install Debian files on Linux as well as your options for uninstalling and updating them.

As you look for new software, you'll find there are in fact many ways to get applications installed on Linux.