Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been wondering, is there a way to tell dpkg or apt-get that when I want to install a package also install all the dependencies it requires? I installed a package using dpkg but it complained about some dependency issues so I had to manually search one by one, is there a better way to do this?

share|improve this question
dpkg does not handle dependencies, it's a low level package management tool. – João Pinto Jan 4 '11 at 17:23
up vote 9 down vote accepted

Dependencies should be installed by default with apt-get. You might also want to read the answers for this question: Installing suggested/recommended packages?.

share|improve this answer
And if it doesn't?! I run this command: "apt-get install --no-install-recommends ubuntu-desktop, And it says The foloowing packages have unmet dependencies: checkbox-qt, eog,gedit,....... too many packages. – Mr.Hyde Sep 30 '15 at 5:32

apt-get or aptitude will install all the dependencies of a package. According to apt-get man page

All packages required by the package(s) specified for installation will also be retrieved and installed.

Even if you want to install a package from source you can install its build dependencies using apt-get. Use apt-get build-dep for that purpose. Again from apt-get man page:

build-dep causes apt-get to install/remove packages in an attempt to satisfy the build dependencies for a source package.

For example if you want to compile gcc you will need all the build dependencies for successfully compiling gcc. So you use sudo apt-get build-dep gcc. This will install all the packages required to build gcc from source.

share|improve this answer
thats cool...... – One Zero Feb 8 '12 at 16:52

If after using dpkg to install a package it tells you that there are missing dependencies, you can run apt-get -f install to install any missing dependencies on your system.

share|improve this answer

If you're looking for a tool that will install a downloaded (ie. non-repository based) package including dependencies, look at gdebi (the GTK UI) or gedebi-core (the command line tool).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.