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

Is there an application by which the build dependency as well as the source code of the software gets downloaded automatically as soon as we install the software from a .deb package or the software center?

share|improve this question

To install the build dependencies for foo, run

apt-get build-dep foo

To get the source code, run

apt-get source --download-only foo

Note that this downloads three files into the current directory: a tarball of the source code, a compressed .diff.gz patch file, and a .dsc metadata file. Omit the --download-only option to have the command unpack the source code for you too.

If you'd like this to happen automatically, you could write a wrapper script that automatically calls each of apt-get install, apt-get build-dep, and apt-get source.

If you installing directly from .deb files instead of accessing an APT repository, then you might not be able to do this, because .deb files do not contain source code, or even a link to the source code they were built from.

There is some more information on the apt-get man page.

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.