How to install .deb file with dependencies

In a Debian-base system, 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, typical .deb package has dependencies (or prerequisite packages) which need to be pre-installed for the .deb package to be able to be installed, 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:

When it comes to dealing with dependencies of .deb files, a Linux tool called gdebi is a blessing. 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 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.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

14 thoughts on “How to install .deb file with dependencies

  1. Cool. I forgot about this since Ubuntu Software Center does the same, just soooo much slower. however, dpkg -i *.deb installs all debs in a folder at once, which is good when they depend on each other. Do you know if gdebi does the same?

    • I think this is somewhat different. It's like solving dependencies after install. So if unresolved dependencies cannot be fixed by subsequent apt-get, it can become messy.

  2. for GTK users, gnome-packagekit has a better installer called "Software Install" that I use over gdebi now.

    gnome-packagekit: /usr/bin/gpk-install-local-file

  3. The issue with gdebi is that it only looks for dependencies in repositories. I can't install packages that depend on each other, even with gdebi *.deb

      • by that comment i will assume that you are not a linux user :) Dependencies in linux are equivalent to using another program developed by someone else. In windows and linux ffmpeg is a well know command-line tool for converting audio and video formats, So let's say developer comes along and makes a program to convert audio and video files taking care of all the command line work for end users. Now we have a fully functional audio and video converter (gui) without the hassle of using the command line. ffmpeg is a dependency of this new program because the program depends on ffmpeg to do the work behind the scenes. Unlike windows where a program can be downloaded but not have the dependencies that it needs, when a linux program is compiled, a small list of programs that it needs to run are built into the build to ensure that packages don't fail but when a dependency can't be downloaded any longer (security vulnerabilities, no longer being developed, or buggy with the new os) the package will fail to build with dependency issues.

Leave a comment

Your email address will not be published. Required fields are marked *