Aptitude – How to Download a Package and Its Dependencies with Aptitude

aptaptitudedebiandependenciespackage-management

I am trying to download some debian packages and their dependencies in a directory.

I tried using the command aptitude download <package_name> it downloaded the package without its dependencies.

How do I tell it to download the dependencies too?

Best Answer

You can use apt-rdepends to build the complete set of dependencies (recursively), including the main package, then download that:

apt-get download $(apt-rdepends "${package}" | grep -v ^\ )

(replacing "${package}" of course).

Related Question