Learn how to install deb files on Ubuntu Linux with this step by step guide. Also, learn how to remove the deb packages or files.
If you are new to Linux, then you might be wondering how to install software on the Linux operating system. Ubuntu does provide a software center where you can search and install the programs.
But you will not find all the software on the Ubuntu software center. You might want to install third-party software on Ubuntu and Linux software is generally available in .deb packages format.
There are a couple of methods to install deb files on Ubuntu.
So, in the guide, you will look at the various methods for installing deb files on Ubuntu Linux using GUI programs and via command Line using some basic Linux commands.
These methods are applicable to all kinds of Linux distros like Debian, Ubuntu, Linux Mint, and many more.
For installing a deb package, all you need is to download deb package from the particular website and follow the below guide. So let's get started with this guide on how to install deb files on Ubuntu Linux.
The simplest and straightforward method to install deb packages on Ubuntu is using the software center. You simply need to download the deb package and browse to the downloaded location.
Next, double click on it to open the default software center. In the software center installation window, click on install.
Now as soon as you click install, the authentication window will open asking for a password. Simply, enter the password and click authenticate. Now, wait for the installation to complete and you have successfully installed deb package on Ubuntu Linux.
Sometimes, double-clicking on the deb files opens it with an archive manager and doesn't open it with the software center.
In that case, simply right click on the file and select open with option.
From the options list, select the "Software Install" option and click on the select option as seen in the screenshot.
Now double-clicking on the deb file should open in the software center and you should be able to install deb files easily.
Installing deb file using GUI can be easy but sometimes, the deb packages do not get installed and might throw a bunch of errors like dependency errors.
The method is highly useful when the deb package you want to install has certain dependencies that it requires to install or work. And this leads to the infamous dependency error.
Software Center cannot handle such type of errors and so we need an alternative that can handle these errors.
gdebi is one such application, it is a GUI (graphical user interface) application that is used for installing deb files in Ubuntu and other Linux distros.
You can install gdebi from the Ubuntu software center. Just open the Ubuntu software center and search for gdebi and click on install.
Alternatively, you can also install gdebi from the command line. Open your Linux terminal and use the following command to install gdebi on Ubuntu Linux.
sudo apt install gdebi
Once, you have installed gdebi on your Linux machine. You can use gdebi as a GUI application or from the terminal for installing deb packages.
Download the deb package and browse to the download location. Now right click on the deb package and click open with other applications.
From there select GDebi package installer and click select as seen in the screenshot.
Now the installation window will open, simply click on the install package and wait for the installation to complete. It will also install the required dependencies if any.
You can also install deb files in Ubuntu from the terminal using gdebi. Open the Linux terminal in the downloaded package folder and use the following command for installing deb files.
sudo gdebi deb_file
Now provide the password and wait for the installation to complete. gdebi is really fast and perhaps a better tool than the software center for installing deb files on Ubuntu Linux.
You can also install deb packages or files using the apt command. Installing deb package using apt is also straightforward and easy. Moreover, it also installs dependencies as well.
First of all, download the deb package and open the terminal. And use the following command for installation of deb package on Ubuntu using the apt command as seen in the screenshot.
sudo apt install path_deb_file
Note that you have to use the path to the file for installing using the apt command. The path can be a relative or absolute path. If you use only the name, then you will get not found an error.
As soon as you press enter, you will be asked for sudo password. Provide the password and press enter to begin the installation.
dpkg is another command similar to apt which you use to install deb file on Linux. It is also easy and straightforward to use just like the apt command.
First of all, download the deb package and open the terminal inside the folder where the deb package is downloaded. You can also provide a path to the downloaded deb package.
Now use the following command for installation of deb package on Ubuntu using the dpkg command.
sudo dpkg -i deb_file
Now, you will be asked for sudo password. Enter your password and press enter. And wait for the installation to complete.
Now you have successfully installed deb package on Ubuntu using the dpkg command from the command line.
Please note that if a deb file requires dependencies, then this method will not work and throw a dependency error. And in that case, you have to use the gdebi method mentioned above.
Removing deb files from the Linux machine is also simple and straightforward.
If you know the exact package name and a simple command will be enough to remove deb package from Ubuntu Linux. Otherwise, you can search for installed deb packages on the Linux machine and then remove the appropriate package.
Now you can remove deb package using the apt as well as dpkg command.
You can remove deb packages from the Ubuntu Linux using the following simple Linux command inside the terminal.
sudo apt remove package_name
Now, if you exactly know the package name then just use the above command and replace the package_name with package name you want to remove.
Now, what if you don't know the exact name of the installed package.
Now that is where
grep command comes handy. You can use the grep command to search through the installed packages.
For example, if I have a package named Teamviewer. Then, I can use the following command to look for all the packages containing the word viewer.
sudo apt list --installed | grep viewer
Running this command will list all the packages that contain the word viewer.
And after you can use the apt remove command to remove the installed deb package on Ubuntu. For eg,
sudo apt remove teamviewer
You can also remove deb files using the dpkg command. For removing the package you can use the following command.
sudo dpkg -r package_name
Like apt, if you know the exact package name, you can use the above command and remove the package.
But if you do not the exact name, you can also list the installed package or search for a specific installed package just like apt as mentioned above.
For eg, to find the package name containing word viewer, you can use the following command.
sudo dpkg -l | grep viewer
Now it will list all the packages containing the word viewer and use the dpkg remove command to remove the appropriate package.
sudo dpkg -r teamviewer
Wait for the installation to complete and you have successfully removed the deb package from the Ubuntu Linux. Please note that for removing packages you have to use sudo.
How do I Install Packages in Ubuntu?
Ubuntu, by default, has a command-line utility called APT (Advanced Package Tool) for installing, removing, and managing deb packages on Ubuntu, Debian, Linux Mint, and other Linux distros.
Can I delete deb File after Install?
Yes, it is perfectly safe to delete the deb file after you have installed on your Linux operating system.
How do I install a deb file in Terminal?
apt, dpkg and gdebi are some of the most popular command-line utilities that you can use to install deb file in terminal.
That's all! These were the various methods to install deb files on Ubuntu Linux using GUI and from the command line.
We also looked at how you can remove the installed deb packages from Ubuntu and other Linux distros.
Installing deb files or removing is a simple and straightforward process and requires a couple of basic Linux commands to the work done.
If you enjoyed the article please share it on social media. If you have any suggestions or query please let me know in the comment section.