How to Install Deb Files (Packages) on Ubuntu

Introduction

A deb package (.deb file) is a software package format designed for Debian-based distributions, identified by the .deb extension. These packages facilitate the installation of local software on an Ubuntu system.

This article outlines multiple methods for installing and removing deb packages on Ubuntu.

Prerequisites

  • A system running Ubuntu
  • Access to a terminal window or command line
  • A user with root or sudo privileges

Install deb Files Using GUI

Installing deb files via the GUI is simple and convenient. Here are the two most common methods for installing deb packages through the user interface.

Option 1: Software Center

To install a deb package using the Software Center (Ubuntu Software), follow these steps:

  1. Find the downloaded deb package. By default, it is stored in the Downloads directory.
Deb package in Downloads

2. Right-click the deb file and select “Open With Other Application.”

3. Select Software Install from the program list.

deb file Open with Software Installer menu

A new dialogue box opens with details about the software.

4. Click on the Install button to proceed.

deb package install from software center

5. Enter the user’s password when prompted and press Enter to authenticate.

Software installation authentication request

6. Wait for the installation to complete. When finished, the software is ready to use.

Option 2: GDebi GUI

GDebi is a straightforward tool for installing local deb packages. It identifies all required dependencies and automatically downloads and installs them using the apt package manager. GDebi is available as both a command-line and GUI tool.

Note: GDebi is not included by default in Ubuntu. To install it, use the following command:

sudo apt install gdebi -y

To install a deb package using the GDebi GUI, follow these steps:

  1. Open the file manager and locate the deb file.
  2. Right-click on the deb file and select “Open With Other Application.”
  3. Choose “GDebi Package Installer” and click “Select.”
GDebi select installer menu

4. The installer will load the deb package and display the software description. Click “Install Package” to begin the installation.

GDebi GUI installer

5. Enter your user password when prompted and press “Enter.”

6. Wait for the installation to finish. Once it’s done, the software is ready to use.

Install deb Files using the Terminal

The Ubuntu terminal allows for the installation of packages using various package managers and commands. Here are a few options to install deb packages using terminal commands.

Option 1: dpkg Command

The dpkg command serves as a package manager for installing, removing, and building packages.

To install a deb package using the dpkg command, execute the following command:

sudo dpkg -i <package path>
sudo dpkg -i terminal output

Enter the user’s password and wait for the installation to finish. If a package relies on unavailable dependencies, the dpkg command will return an error. You’ll need to download any dependencies manually.

Option 2: apt Package Manager

The apt command executes the apt package manager software. To install a deb package using the apt command, use the following command:

sudo apt install <package path>
sudo apt install deb package terminal output

If prompted, enter the user’s password. The package manager will also automatically locate and install any dependencies.

Option 3: GDebi Package Installer

GDebi also functions as a command-line tool for package installation. To install a deb package with GDebi in the command line, run the following command in the terminal:

sudo gdebi <package path>
sudo gdebi install deb package

Press Y to confirm the installation and enter the user’s password.

How to Remove deb Packages

There are various methods to remove a previously installed deb package, depending on how it was initially installed. Below are examples of several options to remove deb packages from the system.

Option 1: Software Center

To uninstall a deb package using the Software Center, follow these steps:

  1. Open the Ubuntu Software application.
Applications Ubuntu software

2. Navigate to the Installed tab.

Ubuntu Software Installed tab

3. Locate the software you want to remove. Click Uninstall to remove the application.

software center uninstall button

4. Confirm the uninstallation and provide the user’s password to complete the software removal.

Option 2: GDebi GUI

To uninstall software using GDebi, follow these steps:

  1. Locate the .deb package file on your system.
  2. Right-click the file and choose “Open With Other Application.”
  3. Select “GDebi Package Installer” from the list.
  4. Click “Remove Package” to uninstall the software.
GDebi remove package

5. Provide the user’s password and wait for the uninstall process to complete.

Option 3: dpkg Command

To remove packages installed with dpkg, utilize the following command in the terminal:

sudo dpkg -r <software name>
sudo dpkg -r package terminal output

Use the official package name (not the .deb file name) in the command.

Option 4: apt Package Manager

To uninstall a package using the apt command, run the following:

sudo apt remove <software name>
sudo apt remove package terminal output

Press Y to confirm the removal.

This method works if the initial installation was done through the Ubuntu Software Center or the apt package manager.

Conclusion

Now you’re familiar with various methods to install and remove local software packages (.deb) on Ubuntu.

Leave a Comment