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.
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.
For a full list of build dependencies, including the build dependencies' build dependencies, you can use:
apt-rdepends --build-depends libreoffice
The command may remind you to install apt-rdepends first. If you get the error "You must put some 'deb-src' URIs in your sources.list", then see this question.
You can use the following command to only show the ones that are not installed:
apt-rdepends --build-depends --print-state libreoffice | 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.
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>
You can use apt for this:
apt showsrc python3 | grep '^Build-Depends'
In this example, I'm looking at the information of python3's source package, filtering only for lines that begin with Build-Depends.
For this to work, you will need to have sources enabled in your sources.list.