install deb file in linux

How to Install .deb File in Ubuntu

.deb files are installable software packages for Ubuntu/Debian Linux. In this article, we will look at how to install .deb file in Ubuntu/Debian Linux.

How to Install .deb File in Ubuntu

Here are the different ways to install .deb file in Ubuntu.

1. Using terminal

You can use apt or dpkg command to install .deb files. Open terminal and run the following command to install debian package file (.deb file).

$ sudo apt install /path/to/deb/file

If you get a message about dependency error, use the -f option to install dependencies too.

$ sudo apt install -f /path/to/deb/file

For example, if you have a .deb file at /home/ubuntu/google_chrome.deb then run the following command.

$ sudo apt install /home/ubuntu/google_chrome.deb

Here is the command to install .deb file using dpkg command.

$ sudo dpkg -i /home/ubuntu/google_chrome.deb

2. Using GUI

You can also install .deb packages via Ubuntu’s Software center. Open software center, go to the folder where you have downloaded .deb file and double click it.

You will see a window which displays details about the package. You need to click Install button to install the package.

That’s it. It is just like installing software on Windows by double clicking .exe file.

How to Remove .deb package

If you want to remove .deb package from your system, you may run the following command.

$ sudo apt remove package_name

If you want to find out the exact name of your package, use apt list command which provides a complete list of all installed packages, and then pipe it to grep command to search for the required package name. Here is an example to find package name of chrome browser. It will list all installed package with ‘chrome’ in its name.

$ sudo apt list --installed | grep chrome
google_chrome/now 40.298 all [installed,local]

Once you know the name of your package, you can use it in apt remove command.

$ sudo apt remove google_chrome

Similarly, you can also use dpkg command to remove your package. Use the following command to find the exact name of your desired package.

$ sudo dpkg -l | grep google_chrome
ii  google_chrome        0.298         all        

Once you know the exact name of your package, you can delete it using the following command. Replace google_chrome below with your package’s exact name.

$ sudo dpkg -r google_chrome

That’s it. In this article, we have looked at how to install .deb files in Debian/Ubuntu Linux. We have also learnt how to remove or uninstall .deb packages. Typically, you will be able to search the package of your choice in Ubuntu’s software center and install it from there. But in case you are unable to find it there, you can download its .deb file online and install it using the steps mentioned above.

Also read:

How to Kill Process Running on Specific Port
Sed Command to Delete Lines in Linux
How to Install & Use Wine in Linux
How to Iterate Over Multiple Lists in Parallel in Python
How to List All Files in Directory in Python

Leave a Reply

Your email address will not be published. Required fields are marked *