Linux Commands

How to Install .deb File with Dependencies in Linux

The .deb is a Debian software package file mostly used in Linux systems to install the latest version of software or package that are not available in the default system repository. The deb package includes the required dependencies needed to install a deb package thus these dependencies will be installed once you install the deb file on the system.

If you don’t the ways to install the .deb file with dependencies on a Linux system, follow this tutorial.

How to Install .deb File with Dependencies in Linux

Following are multiple methods to install a .deb file with dependencies in a Linux system:

Method 1: Install .deb File Using apt/apt-get Command

apt is a command line tool for managing like installing, updating, upgrading, and removing the packages in Linux. A .deb file on a Linux system can be installed via this command line utility. The following syntax is used to install the .deb file:

sudo apt install ./<.deb-file>

As an example, I have installed the .deb package of Viber in Linux.

sudo apt install ./viber.deb

You can also install the .deb file from the apt-get command:

sudo apt-get install ./deb_file

Method 2: Install deb Package Using dpkg Command

dpkg is a package manager preinstalled in Linux based system and you can utilize this tool to install a deb package as well. For this purpose, you must follow the below-given syntax:

sudo dpkg -i deb_file

For the installation of Viber on Linux using the .deb package, I have applied the following command:

sudo dpkg -i viber.deb

The above methods won’t install dependencies, so, to install the dependencies run the command mentioned below:

sudo apt install -f

The drawback of this approach is that you need to execute two commands.

Method 3: Install .deb File Using Software Manager

Another easiest way of installing the .deb file in Linux is through the Software Manager. Right-click on the installed file and choose another application. A new window will pop up on your screen, select the Software Manager:

The Software Manager will open up, click on the Install button to Install the specific package on Linux.

Remove the .deb File in Linux

If you have installed a deb package on the Linux system, you can remove it anytime by using the following apt command.

sudo apt remove <application-name>

Or:

sudo apt-get remove <application-name>

Removing Viber:

sudo apt remove viber

Bottom Line

Deb files can be installed on a Linux terminal from apt, apt-get, dpkg, or gdebi command line methods. All these methods use a single command to install a deb package on the system. Other than the command line, you can also install the .deb file using the Software Manager, which directly installs the package on the Linux system from the GUI.

About the author

Zainab Rehman

I'm an author by profession. My interest in the internet world motivates me to write for Linux Hint and I'm here to share my knowledge with others.