Installing .deb files in Debian/Ubuntu based Linux Distributions

Image courtesy:

Method 1: Use the default Software Center

The simplest method is to use the default software center in Ubuntu. You have to do anything special here. Simply go to the folder where you have downloaded the .deb file (it should be the Downloads folder) and double click on this file. It will open the software center and you should see the option to install the software. All you have to do is to hit the install button and enter your login password.

Method 2: Use Gdebi application for installing deb packages with dependencies

If a developer is preparing the DEB package for you, he/she may assume that your system already has that piece of software on your system to install those packages. If you do not have such software, Gdebi will help you to install it.gdebi is a lightweight GUI application that has the sole purpose of installing deb packages. It identifies the dependencies and tries to install these dependencies along with installing the .deb files. It is nice for those who don't have a command-line background.

You can install gdebi from the software center or using the command below:

sudo apt install gdebi

Method 3: Install .deb files in the command line using dpkg

If you want to install deb packages in command lime, you can use either apt command or dpkg command. Apt command actually uses dpkg command underneath it but apt is more popular and easy to use.

If you want to use the apt command for deb files, use it like this:

sudo apt install path_to_deb_file

If you want to use dpkg command for installing deb packages, here’s how to do it:

sudo dpkg -i path_to_deb_file

eg: sudo apt install Downloads/anydesk_5.1.2-1_amd64.deb
    : sudo dpkg -i Downloads/anydesk_5.1.2-1_amd64.deb

In both commands, you should replace the path_to_deb_file with the path and name of the deb file you have downloaded.

If you get a dependency error while installing the deb packages, you may use the following command to fix the dependency issues:

sudo apt install -f

How to remove deb packages

Removing a deb package is not a big deal as well. And no, you don’t need the original deb file that you had used for installing the program

Method 1: Remove deb packages using apt commands

All you need is the name of the program that you have installed and then you can use apt or dpkg to remove that program.

sudo apt remove program_name

dpkg -r program_name

eg: sudo apt remove anydesk_5.1.2-1_amd64.deb
    : sudo dpkg -r anydesk_5.1.2-1_amd64.deb

if you don't know the exact filename, You can find the list of all installed files with apt command but manually going through this will be a pain. So you can use the grep command to search for your package.

sudo apt list --installed | grep grid

This will show you all the packages that you have installed and from there, you can get the exact program name.

0 Komentar