Newsletter Subscribe
Enter your email address below and subscribe to our newsletter
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.
Table of Contents
In this section, I will walk you through two methods to install deb files in Ubuntu using GUI:
Let’s start with the first one.
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:
Open With...
:App Center
and press the Open
button:Install
button and it will ask you to enter your password: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.
Open With...
:GDebi Package Installer
option and hit the Open
button:Install Package
button and it will ask for the user password. Once you enter the password, it will start installing the deb file:3 steps is all it takes 🙂
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:
As always, let’s start with the first one.
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
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
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
If you want to uninstall deb packages from Ubuntu, I will show you two simple ways to do so:
Let’s start with the GUI method.
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:
Open With...
:GDebi Package Installer
option:Remove Package
button and it will ask for the user 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
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
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.