Enter your email address below and subscribe to our newsletter

How to Install Deb Files (Packages) on Ubuntu [5 Ways]

Learn how to install deb files in Ubuntu using terminal and GUI.

Share your love

When you try installing a package on Ubuntu, you will come across packages like Chrome which are neither available in the default repository nor in third-party or PPA. In those times, the easiest way to install that package is to install that package as a deb file in Ubuntu.

So in this tutorial, I will walk you through 5 simple ways you can install deb files in Ubuntu which includes GUI and Terminal methods. This way you can choose what fits the best according to your workflow.

I will also explain how to remove deb packages at the end of the tutorial.

Install deb files in Ubuntu using GUI

In this section, I will walk you through two methods to install deb files in Ubuntu using GUI:

  • Install deb packages using the App Center
  • Install deb packages using GDebi GUI

Let’s start with the first one.

Method 1: Install deb files using the App Center

By far, this is the easiest way one can install deb files in Ubuntu as it does not require any installation steps or a terminal.

To install deb files using the software centre, follow the given steps:

  1. First, open your file manager and go to the directory where the deb file is available. For most users, it will be in the Downloads directory. Here, right-click on the deb file and select the second option Open With...:
    Choose open with other app
  2. Now, choose the first option App Center and press the Open button:
    Select App Centre
  3. It will open the App Center of Ubuntu App Center. Here, you have to press the Install button and it will ask you to enter your password:
    Install deb files using app center in Ubuntu
    Yep, that’s it!

Method 2: Install deb files using GDebi GUI

If you don’t like the idea of using App Center and want to use something more flexible, then you can use GDebi, a tool which lets you install deb files using GUI and CLI.

Unlike App Center, GDebi does not come pre-installed so you have to install it manually using the following command:

sudo apt install gdebi

Once done, follow the given steps.

  1. First, open the file explorer and open a directory where the deb file is located. There, right-click on the deb file and select the second option Open With...:
    Choose open with other app
  2. Now, choose the GDebi Package Installer option and hit the Open button:
    Choose GDebi for installing deb files in Ubuntu
  3. It will open the GDebi installation prompt. Press the Install Package button and it will ask for the user password. Once you enter the password, it will start installing the deb file:Install deb files using GDebi GUI installer

3 steps is all it takes 🙂

Install deb files in Ubuntu using the terminal

If you believe you are a pro user and using GUI is not your thing (like me), then in this section, I will walk you through 3 ways you can install deb files in Ubuntu using a terminal:

  • Install deb files using the apt command
  • Install deb files using the dpkg command
  • Install deb using using GDei CLI

As always, let’s start with the first one.

Method 1: Install deb files using the apt command

This is my go-to method as it is quite similar to installing packages directly from the repository of Ubuntu.

Before you use the apt command to install deb files on Ubuntu, make sure to switch to the directory where the deb file is located. To do so, you can use the cd command as shown here:

cd <directory-name>

Here’s the command syntax you need to follow to install deb files using the apt command in Ubuntu:

sudo apt install ./<package.deb>

Let’s say I want to install a Google Chrome deb file on Ubuntu which is located in the Downloads directory, so I will be using the following:

cd ~/Downloads
sudo apt install ./google-chrome-stable_current_amd64.deb 
Install deb files using apt command in ubuntu

Method 2: Install deb files using the dpkg command

In past, I had some issues while installing deb files using the apt command and dpkg came as a saviour. I haven’t had a single instance where the dpkg command has failed me.

To install deb files using the dpkg command, first, you need to switch to the directory where the deb file is located using the cd command:

cd <directory-name>

Now, you can use the dpkg command with the -i command to install the deb file as shown here:

sudo dpkg -i <package.deb>

For example, if I want to install the deb file of Google Chrome, then my command would look like this:

sudo dpkg -i google-chrome-stable_current_amd64.deb
Install deb files using dpkg command in Ubuntu

Method 3: Install deb files using GDebi CLI

In the previous section, I explained how you can use GDebi to install deb files using GUI but it can also be used as a command to install deb files in the terminal.

If you haven’t installed GDebi, you can use the following command to install it on Ubuntu:

sudo apt install gdebi

Now, switch to the directory where the deb file is located and use the gdebi command as shown to install the deb file in Ubuntu:

sudo gdebi <package.deb>

As I wanted to install Google Chrome, I would use gdebi in the following manner:

sudo gdebi google-chrome-stable_current_amd64.deb
Install deb files in terminal using gdebi command in ubuntu

Uninstall deb files from Ubuntu

If you want to uninstall deb packages from Ubuntu, I will show you two simple ways to do so:

  • Using GDebi (GUI method)
  • Using apt remove (Terminal method)

Let’s start with the GUI method.

GUI method: Uninstall deb files using GDebi

From Ubuntu 24.04, you can not use App Center to uninstall deb packages so we are left with few choices and GDebi is one of them. To uninstall deb files using GDebi, you will have to follow the given steps:

  1. First, you need to locate the deb package which you used to install the package in the first place. Once you find it, right-click on the deb file and select the second option Open With...:
    Choose open with other app
  2. Now, choose the GDebi Package Installer option:
    Choose GDebi for installing deb files in Ubuntu
  3. Finally, press the Remove Package button and it will ask for the user
    Remove deb file in Ubuntu using GUI

Terminal Method: Uninstall deb files using apt

This is a little tricky method as you need to know the exact name of the file before removing it. So if you try sudo apt remove chrome, it won’t work and gives you an error.

So the first step is to find the correct name of the package. To do so, you can use the apt list command in combination with the grep command as shown here:

apt list --installed | grep -i <package-name>

For example, if I want to remove Google Chrome from Ubuntu, then I would use the following command to find the exact name of that package:

apt list --installed | grep -i chrome
Find exact name of the deb package to remove it from ubuntu terminal

As you can see, the exact name of the package is google-chrome-stable.

Once you know the exact name of the package, you can use the apt remove command in the following manner to remove that deb package from Ubuntu:

sudo apt remove <exact-name-of-deb-package>

In my case, the command to remove Google Chrome from Ubuntu would look like this:

sudo apt remove google-chrome-stable
Uninstall deb package from Ubuntu using terminal

Wrapping Up…

In this tutorial, I went through 5 ways you can install deb files in Ubuntu and at the end, I have also mentioned two ways you can uninstall deb files from Ubuntu.

If you ask me, I find the dpkg command a robust solution to install deb files in Ubuntu as it has never failed on me. Let me know what method is your go-to.

Share your love
Kabir
Kabir

A tech journalist whose life revolves around networks.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!