How to Install Deb Files (Packages) on Ubuntu

May 25, 2023

Introduction

A deb package (.deb file) is a software package in a specific format designed for Debian-based distributions recognized by the .deb extension. Deb packages allow installing local software on an Ubuntu system.

This article shows several ways to install and remove deb packages on Ubuntu.

tutorial on installing deb packages on Ubuntu

Prerequisites

  • A system running Ubuntu.
  • Access to terminal window/command line.
  • User with root/sudo privileges.

Install deb Files Using GUI

Installing deb files through the GUI is straightforward and convenient. Below are the two most common options that allow installing deb packages through the user interface.

Option 1: Software Center

To install a deb package with the Software Center (Ubuntu Software), follow the simple steps below:

1. Locate the downloaded deb package. By default, the system stores downloaded files in the Downloads directory.

Deb package in Downloads

2. Right-click the deb file and choose Open with Another 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 simple tool for installing local deb packages. The program also identifies all the required dependencies and automatically downloads and installs them using the apt package manager. GDebi is available both as a command-line and GUI tool.

Note: GDebi does not come on Ubuntu by default. 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 choose Open With Other Application.

3. Mark the GDebi Package Installer and click Select.

GDebi select installer menu

4. The installer loads the deb package and shows the software description. Click Install Package to start the installation.

GDebi GUI installer

5. Provide the user password when prompted and press Enter.

6. Wait for the installation to complete. Once done, the software is ready to use.

Install deb Files using the Terminal

The Ubuntu terminal enables installing packages using different package managers and commands. Below are a few options to install deb packages using terminal commands.

Option 1: dpkg Command

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

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

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

Provide the user's password and wait for the installation to complete. If a package relies on unavailable dependencies, the dpkg command returns an error. Download any dependencies manually.

Option 2: apt Package Manager

The apt command runs the apt package manager software. To install a deb package using the apt command, run:

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

Provide the user's password if prompted. The package manager also locates and installs any dependencies automatically.

Option 3: GDebi Package Installer

The GDebi tool also works as a command-line tool for package installation. To install a deb package with GDebi in the command line, run the following 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 several different ways to remove a previously installed deb package. The removal method depends on how the package was initially installed.

Below are examples of several options to remove deb packages from the system.

Option 1: Software Center

To remove a deb package using the software center, do the following:

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 with Gdebi, do the following:

1. Locate the .deb package file on the system.

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

3. Choose 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, use 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.

The method works if the initial installation was through the Ubuntu software center or the apt package manager.

Conclusion

You now know several ways to install and remove local software packages (.deb) on Ubuntu. Next, see different ways to list installed packages on Ubuntu.

Was this article helpful?
YesNo
Milica Dancuk
Milica Dancuk is a technical writer at phoenixNAP with a passion for programming. With a background in Electrical Engineering and Computing, coupled with her teaching experience, she excels at simplifying complex technical concepts in her writing.
Next you should read
How to Uninstall or Remove Software Packages From Ubuntu
May 23, 2024

This guide will walk you through several methods for removing old or unwanted software from an Ubuntu Linux...
Read more
How to Install RPM Packages on Ubuntu
March 28, 2024

RPM is a package format used by Red Hat based derivatives like CentOS, RHEL or Fedora. It gets its name from...
Read more
How to Use The APT-GET Command In Linux
May 6, 2019

Advanced Package Tool (APT) is a package management system used on Debian, Ubuntu and other Linux...
Read more
How To Use grep Command In Linux/UNIX
February 29, 2024

This guide details the most useful grep commands for Linux / Unix systems. After going through all the...
Read more