How can I direct apt-get to download package and its dependencies to some other location?

How can I direct apt-get install package_name to download package and its dependencies to some other location instead of /var/cache/apt/archives?


You can download a package and all its dependencies with the following command, provided neither the package nor its dependencies are installed in the machine:

sudo apt-get --download-only -o Dir::Cache="/path/to/destination/dir/" \
    -o Dir::Cache::archives="./" install package_name

Just try:

cd /directory
apt-get download package_name*