How to Install deb Files in Ubuntu 24.04

A deb file, short for Debian package file, is a package file format used by the Debian Linux distribution and its derivatives, such as Ubuntu, Linux Mint, and many others. A deb package file is an archive that contains executables, scripts, and data files required for package installation. Ubuntu is a variant of Debian-based Linux distributions, so a deb file of software can be installed on it using various methods.

In this guide, I will be explaining how to install the deb package on Ubuntu 24.04 Noble Numbat using different methods including GUI and CLI.

  1. Install Deb Files/Packages in Ubuntu 24.04
  2. Command Line Methods to Install Deb Files
  3. GUI Methods to Install Deb Files
  4. How to Fix Missing Dependencies after Installing the Deb File on Ubuntu
  5. How to Fix dpkg frontend lock was locked by another process with pid Error on Ubuntu
  6. Uninstall Deb Files on Ubuntu 24.04

Install Deb Files/Packages in Ubuntu 24.04

The deb file can be installed in Ubuntu using two approaches. 

  • Through Command Line
  • Through GUI

Command Line Methods to Install Deb Files

Multiple command line utilities can install a deb package via the command line such as dpkg, and apt. 

1. Using dpkg Command

The dpkg is a powerful command line utility in Debian-based distributions including Ubuntu. It is a lower-level tool used to manage packages and serves as the backend of higher-level package management tools. To install a deb file using dpkg, use the steps given below:

Step 1: Open Terminal

Launch the terminal using the ctrl+alt+T keys or from the dash menu.

Step 2: Install the deb File using dpkg –install

To install the deb file, the –install or -i command line utility is used.

sudo dpkg -i <file_name.deb>

Replace the <file_name.deb> with the name of the desired package.

Image 705

2. Using apt Command

APT is a package management tool on Ubuntu that acts as a front-end utility for dpkg. It is the default package manager of Ubuntu. To install a deb package using the apt command, follow the instructions given below:

Step 1: Open Terminal

Launch the terminal using the ctrl+alt+T keys or from the dash menu.

Step 2: Install the deb File using apt install 

Now, install the deb file using the apt install command and the path of the package file.

sudo apt install /<path>/<file_name.deb>

Replace the <file_name.deb> with the actual package name. For example, to install the deb file of TeamViewer software, use:

sudo apt install ./teamviewer_arm64.deb
Image 704

3. Using gdebi Command (Optional)

GDebi is software that is used to install the deb package through the command line and GUI. It also uses dpkg as the backend. The steps to install a deb file using the GDebi tool are listed below:

Step 1: Install GDebi

To install GDebi on Ubuntu 24.04, use the command given below:

sudo apt install gdebi

Step 2: Install the deb File using gdebi Command

Now, open the terminal, use the gdebi command, and mention the package name to install it.

sudo gdebi <file_name.deb>

GUI Methods to Install Deb Files

Ubuntu provides an easy deb package installation process right from the graphical user interface. There are two methods to install deb files from GUI.

  • Ubuntu App Center
  • GDebi App 

1. Using Ubuntu App Center

The Ubuntu App Center, now called App Center comes in the GUI version of Ubuntu. But if the App Center is not installed, then install it using the command mentioned below:

sudo apt install gnome-software

Step 1: Open the deb File by Double Clicking

Locate the deb file in the file system double click on it. The file will open in the App Center.

Step 2: Install the deb File

Click on the Install button to install the deb package.

Image 703

2. Using GDebi

If you have a minimal installation version of Ubuntu then GDebi is a good choice to install the deb file through GUI.

Step 1: Install GDebi

First, install the GDebi package.

sudo apt install gdebi

Step 2: Right Click the deb File

Now, right-click on the deb file and click on the Open With.. option.

Image 702

From the menu select the GDebi Package Installer application and click on Open.

Image 701

Step 3: Install the Deb File

Now, install the file by clicking on Install Package.

Image 700

How to Fix Missing Dependencies after Installing the Deb File on Ubuntu

Missing dependencies can be resolved using the apt install command with the -f flag.

sudo apt install -f

The above command attempts to fix broken dependencies by using the package management system to automatically resolve and install any missing or conflicting dependencies.

How to Fix dpkg frontend lock was locked by another process with pid Error on Ubuntu

While installing the deb package using the dpkg, you may come across an error saying the dpkg was locked by another process. This means some other process is currently using the dpkg package manager. 

To fix this error first, find out the process ID of the software to which dpkg is locked. Normally the process ID is mentioned in the error as shown in the below-given image.

Image 699

Simply use the kill command with PID to kill the process.

sudo kill -9 <process_id>

If the PID is not mentioned in the error then it can be listed using the lsof command.

sudo lsof /var/lib/dpkg/lock-frontend

Caution: If the issue is not fixed then you may need to remove the lock file which is not recommended. 

Uninstall Deb Files on Ubuntu 24.04

Both approaches can be used to delete installed deb files: GUI and command line. Let’s understand the methods to remove deb packages from Ubuntu 24.04.

1. Using dpkg

To remove a deb package using the dpkg, the command is given below:

sudo dpkg -r <file_name>

2. Using apt

Command to delete an installed deb package using apt is given below:

sudo apt remove <file_name>

3. Using Ubuntu App Center

Right-click on the offline deb file on your system, and then click on Open With option from the context menu. From the new window select Software Install and click on Open.

Image 698

The deb package will be loaded in a new window; click on Uninstall to remove the package from Ubuntu.

Image 697

4. Using GDebi

Right-click on the deb file, and select Open With in the context menu. A list of apps will appear in a new window, click on GDebi Package Installer and the Open.

Image 696

The GDebi package installer window will open, click on Remove Package to uninstall the deb file from Ubuntu.

Image 695

Conclusion

The deb file is indeed a package file that contains binaries, executables, and scripts necessary for the installation and configuration of software packages on Ubuntu and other Debian-based Linux distributions. The deb file on Ubuntu can be installed using the terminal and GUI. To install software via the command line, utilize the dpkg or apt tools, and for graphical interface installations, use Ubuntu App Center or GDebi Package Manager.