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:
 webmin

When 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.

To install gdebi on Debian, Ubuntu or Linux Mint, run the following. It will install both components.

$ sudo apt-get install gdebi

In order to install .deb file with dependencies, simply run gdebi with the target .deb file as follows. Any prerequisite packages will be installed automatically.

$ sudo gdebi webmin_1.620_all.deb

If you would like to use gdebi with graphical front-end, run the following.

$ sudo gdebi-gtk webmin_1.620_all.deb

Then you will see a package installer 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.

11 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 *

Current day month ye@r *