Method 1: Using the default Software Centre
In Ubuntu, the easiest way is to use the default Software Centre. Here you don’t have to do anything special. Just go to the folder where you downloaded the .deb file (it should be the Downloads folder) and double click on this file.

Double click on the downloaded .deb file to start the installation.
It will open the Software Center and you will see the options available when installing the software. All you need to do is: click the install button and enter your login password.

The installation of the .deb file will be performed through the Software Center.
See, it’s even easier than installing an .exe file in Windows, isn’t it?
Method 2: Use the Gdebi application to install the deb package and its dependencies
Now that you know that .deb files can simply be installed via the Software Centre, let me tell you about some of the dependency errors you may encounter with packages.
Errors occur because a program may depend on another package (library). When a developer prepares a DEB package for you, he/she may assume that the dependent package (library) is already available on your system.
However, if this is not the case and your system does not have the required packages (libraries), you will encounter the infamous “dependency error”.
The Software Centre cannot handle such errors, so you will have to use a different tool called gdebi.
gdebi is a lightweight GUI application that has only one purpose for installing deb packages.
It will identify dependencies and try to install them at the same time as the .deb file.

Personally, I prefer to use gdebi rather than using the package centre to install deb files. It’s a lightweight application, so the installation process seems a little faster. For more information you can read about using gDebi and making it the default setting for installing DEB packages.
You can install gdebi from the Software Centre or by using the following command: sudo apt install gdebi
sudo apt install gdebi
Method 3: Installing the .deb file from the command line using dpkg
If you want to install the deb package from the command line, you can use the apt command or the dpkg command. The apt command actually uses the dpkg command under the hood, but apt is more popular and easier 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 the dpkg command for the deb package you are going to install, here’s how to do it
sudo dpkg -i path_to_deb_file
In both commands, you should replace path_to_deb_file with the path and name of the deb file you have downloaded.

If you get a dependency error during the installation of a deb package, you can fix the dependency problem with the following command.
sudo apt install -f
How to remove a deb package
Removing a deb package is not a big deal. Moreover, you don’t need the original deb file used to install the program.
Method 1: Remove the deb package using the apt command
All you need is the name of the program you have installed, which you can then remove using apt or dpkg.
sudo apt remove program_name
Now, the question arises, how do you find the exact program name you need to use in the remove command? For this, the apt command also has a solution.
You can use the apt command to find a list of all installed files, but doing this manually would be a headache. Therefore, you can use the grep command to search for your packages.
For example, in the previous section I had installed the AppGrid application, but if I wanted to know the exact name of the program I could use something like this.
sudo apt list --installed | grep grid
This will give me all the packages with “grid” in their name and from here I can get the exact name of the application.
apt list --installed | grep grid
WARNING: apt does not have a stable CLI interface. use with caution in scripts.
appgrid/now 0.298 all [installed,local]
As you can see, a package with the name “appgrid” has been installed. You can now use this program name in the apt remove command.
Method 2: Remove the deb package using the dpkg command
You can use dpkg to find the name of an installed program: dpkg -l | grep
dpkg -l | grep grid
This output will give all packages that have “grid” in their name.
dpkg -l | grep grid
ii appgrid 0.298 all Discover and install apps for Ubuntu
ii in the output of the above command means that the package has been installed correctly.
Now that you have the program name, you can remove it using the dpkg command
dpkg -r program_name
0 Comments