Introduction

A deb package (.deb file) is a software package in a specific format designed for Debian-based distributions. You can easily recognize this binary package format by its .deb extension.

There are various ways to install software from a deb package, including:

  1. Using the Software Center
  2. Using the GDebi package installer
  3. Using the dpkg command

In this article, we will show you three ways to install a deb package on Ubuntu, along with how to remove the installed software.

How to install deb files on Ubuntu.

Prerequisites

  • Ubuntu 18.04 Bionic Beaver
  • Access to terminal window/command line
  • User with root/sudo privileges

Option 1: Install deb Packages Using the Software Center

If you want to avoid using the command line, installing a deb package via Ubuntu’s Software Center would be the easiest route.

The following instructions outline the steps you need to take:

1. Once you have finished downloading a deb package, click on the Files icon on your desktop and navigate to the Downloads folder. By default, this is where the system stores downloaded files.

example of a deb package in the downloads folder

2. Locate the file you want to install and double-click on it. A new dialogue box opens with details about the software. Click on the Install button to proceed.

install deb package in software manager

3. As authentication is required to install untrusted software, you need to provide the password for your user and click on Authenticate to confirm.

authentication required to install deb package

That’s it! You have successfully installed a deb package on Ubuntu.

Uninstall a .deb File via Software Center

If you have installed a package through the software center, you can remove it by opening a terminal window and running the command:

sudo apt remove [software_name]

Option 2: Install deb Packages Using the GDebi Package Installer

GDebi is a simple tool for installing local deb packages. Apart from installing the specified file, it also identifies all the required dependencies and automatically downloads and installs them using apt.

You can use GDebi via the command-line or the Ubuntu GUI. First, download the tool as it as it is not available on Ubuntu by default:

sudo apt install gdebi -y

command to install gdebi on ubuntu

Now you can use GDebi for installing deb packages.

To install a deb package in the command line, run the following:

sudo gdebi [package_path]

Confirm with y and press Enter.

For instance:

sudo gdebi ./Downloads/vagrant_2.2.2_x86_64.deb

GUI mode

If you want to use GUI GDebi, follow these steps:

1. Open the file manager, and locate the package. In most cases, you can find it in Downloads.

2. Right-click on the deb file and choose Open With Other Application.

how to open deb package with gdebi package installer

3. Doing so opens a new dialogue box with a list of Recommended Applications. Mark the GDebi Package Installer and click on Select.

recommended applications for opening deb package

4. The installer loads the deb package and shows the software description (if available) and whether all the dependencies are satisfied. Click on Install Package, type in the password, and click Authenticate to start the installation.

Removing Software via Gdebi

To uninstall software with Gdebi, open its Package Installer and click on Remove Package.

how to remove software with gdebi

Option 3: Install deb Packages Using the dpkg Command

Another way to install deb packages is with dpkg, a package manager software used for installing, removing, and building packages.

The difference between dpkg and the apt package manager is that the first does not automatically resolve dependencies required by a package. If a package relies on dependencies that are not on the system, dpkg returns an error. This means you’ll need to download them manually.

To install a deb package using dpkg run the command:

sudo dpkg -i [package_path]

Removing Software with dpkg

When removing packages installed with dpkg, use its official name (not the .deb file name) in the following command:

sudo dpkg -r [software_name]

Conclusion

You now know (3) ways of installing or removing Debian packages in Ubuntu. Remember, the first option works only if you are using a GUI.


Next you should also read