How to install a .deb file on Ubuntu

Estimated reading: 4 minutes 252 views

The software distribution landscape is constantly evolving. In Linux environments like Debian and Ubuntu, .deb files are essential packages for software deployment. This step-by-step guide will show how to install a .deb file in Ubuntu 22.04. We will also discover what .deb files are and why they are necessary for managing software on your system.

What is a .deb file?

A .deb file is a package format used in Debian and Debian-based Linux distributions, such as Ubuntu, Linux Mint, or Kali Linux. This software package contains everything needed for installation: the program’s files, details about the software, and scripts to manage the installation process.

Prerequisites

To follow along this tutorial and install deb packages, you will need the following:

  • A system account with administrative privileges;
  • The latest Ubuntu version 22.04 is installed.

How to install .deb file in Ubuntu: 4 Methods

We will cover four different methods to install deb files in Ubuntu, from using the Graphical User Interface (GUI) to using the terminal. We install the browser Opera using the .deb file that you can download from their website.

Your browser will download the file by default in the Downloads folder.

How to open a .deb file?

.deb file being nothing more than an archived file, you can easily open and view its content with the following steps:

  1. Right-click on the .deb file
  2. Select open With Archive Manager

This will show you the content of the .deb file, as shown below:

.deb open with archive manager

We can see that the archive contains three files, namely:

  1. control archive: it contains the maintainer scripts and the package meta-data such as the package name, version, dependencies, etc.;
  2. data archive: it contains the actual files to install;
  3. debian-binary: it contains the package format version number.

We will now go through the different methods to install the .deb file.

Method 1: Install a .deb file using the apt command

The simplest way to install a .deb file is using the apt command, which is installed by default on Ubuntu.

Run the following command in the Downloads folder to install the .deb file:

apt install ./filename.deb
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.14.1-amd64.deb
apt install ./elasticsearch-7.14.1-amd64.deb

Method 2: Install a .deb file using the dpkg command

The dpkg package provides the low-level infrastructure for handling Debian software packages. It is installed by default on Ubuntu.

We can now install the .deb file using the following command:

dpkg -i <debfilename>
wget https://packages.ntop.org/apt/20.04/all/apt-ntop.deb
dpkg -i apt-ntop.deb

.deb open with archive manager

Method 3: Install a .deb file using gdebi GUI

gdebi is a software that allows you to install local deb packages, resolving and installing the .deb dependencies. It also contains a graphical user interface.

Step 1: Install gdebi

You can install gdebi using the following command in your terminal:

apt install gdebi

Setup 2: Now, right-click on the .deb file you want to install and choose “Open With Other Application“.

Install Deb Files on Ubuntu Using Software Center

2. On the next window, choose “Gdebi Package Installer” and then click “Select” at the top right.

Install Deb Files on Ubuntu Using GDebi

3. Finally, click the “Install Package” button to install the deb file on Ubuntu. As you can see next to the “Status” label in the screenshot below, it reads “All dependencies are satisfied”.

Method 4: Install a .deb file using the gdebi command

As gdebi is already installed, we can run the following command to install the .deb file in the terminal:

gdebi apt-ntop.deb

This will unpack and install the content:

.deb open with archive manager

Conclusion

In this tutorial, we showed how to install a .deb file in Ubuntu using four different methods, from terminal to GUI. Nowadays, most of the tools used for installation manage the dependencies, which makes the process easier. You can read more about the Debian package on the official Debian wiki.