Ubuntu primarily has free and open-source software in its repositories. Some proprietary software can be installed directly from the repos, whereas you’ll have to download the deb package and perform a local install for others.
Opening a deb file takes you inside the archive and lists the contents rather than installing the package. If you’re new to Linux and haven’t dealt with deb files before this, this behavior can be confusing.
To install deb files, you have to use a package management tool like dpkg
or apt
. You can also use their graphical frontends like GDebi or the Ubuntu Software Installer.
Install Deb Files Graphically
For newer users, installing deb files with the Ubuntu Software app will feel most intuitive as the process is similar to other platforms. We’ll install TeamViewer as an example here.
- Right-click the deb file and select Open with another application.
- Select Software Install and press Enter.
- This’ll open the program’s page in the Ubuntu Software app with the local deb file as the source. Click on Install here and provide your password for authentication.
- And that’s it. You can now search and launch the installed package from the applications menu.
Use Apt to Install Deb Files
The Ubuntu Software app is just a GUI frontend to APT (Advanced Package Tool). Apt, in turn, is a high-level frontend to dpkg, but more on that later. For now, here’s the basic syntax for installing a deb file with apt.
sudo apt install /path/to/package.deb
sudo apt install /home/anup/Downloads/team_viewer_15.3.deb
If the package is in your current directory, you don’t need to specify the full path. You can just enter the package name like so
sudo apt install ./package.deb
sudo apt install ./discord-0.0.25.deb
When you run these commands, apt first downloads the necessary dependencies to prevent any dependency hell scenarios. Then, it invokes dpkg to install the files.
Install Deb Files With Dpkg
Since apt is just using dpkg under the hood to install deb files, you can directly use dpkg to do the same too.
sudo dpkg -i package.deb
sudo dpkg -i /path/to/package.deb
The only downside to this method is that dpkg doesn’t directly install dependencies. So, if you encounter any dependency errors, you’ll need to use apt with the fix-broken option to resolve it.
sudo apt install -f
You can run the install command again afterward to install the deb file like so
sudo dpkg -i discord-0.0.25.deb
Use GDebi to Install Deb Files
The Ubuntu Software app is easy to use and understand, but the installation can fail due to dependency errors. If you want a GUI-based method that also automatically handles dependencies, use GDebi.
sudo apt install gdebi -y
Right-click the deb file and select Open with another application like earlier.
But this time, select GDebi Package Installer and click on Install Package.
