Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to find out which packages

sudo apt-get build-dep <package>

would install (if I already got some dependencies installed, I'd also like to see those → so running or simulating the above is not enough). Command line preferred.

share|improve this question
1  
I'm confused, doesn't sudo apt-get build-dep <package> show the list of packages (if the package has any build dependencies) it is going to install? –  Alvin Row Jan 13 '11 at 17:54
    
Unfortunately that only shows packages that aren't installed. –  htorque Jan 13 '11 at 17:59
add comment

2 Answers

up vote 18 down vote accepted

For a full list of dependencies, including the dependencies' dependencies, you can use:

apt-rdepends --build-depends openoffice.org

The command may remind you to install apt-rdepends first.

You can use the following command to only show the ones that are not installed:

apt-rdepends --build-depends --print-state openoffice.org | grep NotInstalled

See apt-rdepends --help for all the options.

Note: This will generate a massive list.
apt-rdepends -b xterm, for example, generates 8773 lines of output, and takes it's time doing it.

If you only want to see the packages that are required to build the topmost package, i.e. what do I need to install to build nautilus, run:

apt-rdepends --build-depends --follow=DEPENDS nautilus

This is roughly equivalent to Carsten Thiel's answer (The following NEW packages will be installed), but the output format is a bit nicer. It also only shows the topmost package, whereas simulated apt-get also shows packages installed as dependencies of those.

This also shows packages that are installed. But it may also show packages that are installed by default. Unfortunately, neither method is much help when you're trying to clean up your system after running apt-get build-dep. As far as I know, there isn't a reliable method of finding which ones were installed except from looking at the apt log file at /var/log/apt/history.log.

share|improve this answer
1  
Thanks, the version with --follow=DEPENDS is exactly what I was looking for. You can also find those build dependencies on Launchpad, eg. for Nautilus: launchpad.net/ubuntu/natty/+source/nautilus (scroll down). –  htorque Jan 13 '11 at 19:23
add comment

The option -s (--simulate) will output everything that would be done without doing anything. You don't even need root privileges for that.

apt-get -s build-dep <package>
share|improve this answer
1  
See my comment above - this won't show already installed packages. Sorry for not being precise in my question. –  htorque Jan 13 '11 at 19:28
    
@CarstenThiel: thanks, this helped me. –  0xC0000022L Dec 16 '13 at 12:34
add comment

Your Answer

 
discard

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.