How to Install Deb Files (Packages) On Ubuntu?

Photo of author

By admin

Users of GUI-based operating systems, such as Windows, often have a hard time adjusting to command-line systems. Linux still remains a popular choice for users, be they beginners, programmers, or developers. The first-time users of Ubuntu will find it different from Windows in several ways.

Although the primary version of Ubuntu employs GNOME, a mixture of GUI and command-line interface, many beginners have several questions regarding the operations. One of those questions is how to install Deb files (packages) on Ubuntu.

Honestly, it is not difficult at all, and there are several ways to do so. The best, quickest, and easiest way is to install the application from the Software Center. But all of the applications are not available in Ubuntu repositories, and you may need to download them manually.

While Software Center allows you to install several applications, some applications are contained in Deb packages with .deb extension. You can consider it as the .exe files in Windows.

This guide contains several ways of installing as well as removing deb files on Ubuntu. The guide answers all your questions concerning how to install Deb files (packages) on Ubuntu.

Installing Deb Files (Packages) on Ubuntu

There is no one way of installing Deb files on Ubuntu. You can install it in the following ways-

  1. Using Software Centre
  2. Using dpkg In Command-Line
  3. Using Gdebi Tool
  4. Using apt in Command-Line

Using Software Centre

Of all the ways to install deb files, this one is the easiest.

  1. As the first step, install the deb package for the required application.
  2. Navigate to the folder where the downloaded file is located.
  3. Double-click the file and open up the Software Center. There is the green install button.
  4. Click to start installation.
  5. Authenticate it by entering your password.
  6. Your deb package will be installed.

It is possible that as you double-click the downloaded deb file, it doesn’t take you to the Software Center. In Ubuntu 20.04, it sometimes happens that it guides you to the archive manager. In this case, right-click on the file and click on the “Open With” option. Then click on Software Install to make it your default choice by clicking on “Set as Default” on the bottom-right of the box to finish installation.

Using dpkg in Command Line

The dpkg is a command-line tool that is used under apt command. It is a low-level package manager which uses the (-i) or (–install) option.

You can install the deb file with dpkg with the below-mentioned command.

sudo dpkg -i path_to_deb_file

Instead of path-to-deb-file, use the name of the downloaded deb file.

Dpkg manager does not resolve dependency errors. It would be best if you used apt or gdebi tools for it.

Using Gdebi tool

Often, you choose to install an application in the easiest manner from Software Center, but it shows a dependency error. It happens due to a lack of software which is required for running the application but it is not present on your Ubuntu system. In such a case, you need a tool, which installs the dependencies along with the application.

The tool is the Gdebi tool. It is a GUI tool specially designed to install deb packages. So, when you install a deb package by using the Gdebi tool, it automatically installs all the dependencies required to run that application.

You can install the deb package on Ubuntu in a very simple manner with the given command.

sudo apt install gdebi

That’s it.

Using apt In Command-Line

Apt is a very popular command-line tool and you can use it to install, remove and manage Deb packages. You can use it for installing deb files on Debian, Ubuntu, and other Linux distributions.

Using the command below, you can install deb files on Ubuntu using apt-

sudo apt install path_to_deb_file

Replace path_to_deb_file with the file name of your deb file.

See, it is very easy to get deb files for Ubuntu. Hope, it has answered your question, how to install Deb file (packages) on Ubuntu. But what if you want to remove a deb file?

Removing a Deb File On Ubuntu

If you don’t need an application anymore and want to get rid of it, you can do so. The process is as simple as installing these packages. Once again, by using the Apt and Dpkg command, you can remove deb file packages. Just follow the commands, and remove the Deb files easily. And don’t worry, there is no need for the original deb file to remove the package.

1. Removing deb Files With Apt Command

First of all, if you want to remove a deb file using the Apt command, you need the program name. Now, how to learn the program name is the question? But it is easy to answer. The Grep command will find the exact program name for you.

Say you had installed Teamviewer, and now you want to remove it. You can search its program name by using the grep command in the following manner.

sudo apt list – -installed | grep team

It will return the name of all the packages that have “team” in their name. You can get the program name for the Teamviewer application and then use it in the Apt command to remove the Deb package.

sudo apt remove program_name

2. Removing Deb Files Using Dpkg Command

Once again, you need the program name. Use the grep command as used in the previous method and get the exact program name. Use it in the command given below-

dpkg –r program_name

That’s it.

Final Words

Even the simplest operations can seem impossible when you are just beginning and still in the learning process. If you are used to a GUI-based OS like Windows, switching to a semi-GUI, command-line-based OS like Ubuntu can be challenging. You need the right guide during these times.

Installing deb packages on Ubuntu is easy if you are nimble with the command line. But even if you are not, these simple commands mentioned above will make things easier. This guide will make not only installing but removing the deb package also a cakewalk.

This guide contains different methods using different tools to install and remove Deb files. Using apt, gdebi, dpkg, etc may sound overwhelming at first, but they are popular tools for installing Deb files. You can install your applications in any of the ways mentioned above.

No doubt, this guide has all the answers to your question on how to install deb files (packages) on Ubuntu. So, try these commands, install your application and enjoy Ubuntu.

Leave a Comment