How to install .deb file with dependencies

Last updated on September 11, 2020 by Dan Nanni

In a Debian-base system (e.g., Ubuntu, Linux Mint), program files, libraries and source codes are packaged and distributed as .deb files. Installation of .deb files can be done with a command-line tool called dpkg. However, a typical .deb package has dependencies (or prerequisite packages) which need to be pre-installed for the .deb package to be able to be installed properly, and dpkg cannot resolve such dependencies.

For example, if you attempt to install a package called webmin using dpkg on fresh Ubuntu, dpkg will fail with the following dependency problems.

$ sudo dpkg -i webmin_1.620_all.deb
dpkg: dependency problems prevent configuration of webmin:
 webmin depends on libnet-ssleay-perl; however:
  Package libnet-ssleay-perl is not installed.
 webmin depends on libauthen-pam-perl; however:
  Package libauthen-pam-perl is not installed.
 webmin depends on apt-show-versions; however:
  Package apt-show-versions is not installed.

dpkg: error processing webmin (--install):
 dependency problems - leaving unconfigured
Processing triggers for ureadahead ...
Errors were encountered while processing:
 webmin

When it comes to dealing with dependencies of .deb files, a Linux tool called gdebi is quite user-friendly. With gdebi, you can install .deb files while resolving any unmet dependencies automatically.

The gdebi utility has two components: gdebi for a command-line tool, and gdebi-gtk for graphical front-end. Depending on whether you are on a Linux desktop or a headless server, you can install only a command line tool or a full GUI version.

Install .deb File with Dependencies on a Headless Server

To install gdebi CLI on Debian, Ubuntu or Linux Mint, run the following.

$ sudo apt-get install gdebi-core

Now simply run gdebi with the target .deb file to install it while handling its dependencies. Any prerequisite packages will be installed automatically.

$ sudo gdebi webmin_1.620_all.deb

Install .deb File with Dependencies in a Desktop Environment

While you can still use gdebi CLI tool in the desktop environment, you can also try gdebi with a GUI frontend. For this, install gdebi as follows. Its GTK frontend will also be installed.

$ sudo apt-get install gdebi

Then issue the command below to install a .deb file.

$ sudo gdebi-gtk webmin_1.620_all.deb

You will see a package installer GUI window as shown in the following screenshot.

If there are any dependencies to meet, the status in the window indicates such dependencies, and you can check them out by clicking on Details as shown below.

Finally, simply click on Install Package to proceed with .deb installation.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean