Super User is a question and answer site for computer enthusiasts and power users. 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

What are the options for apt-get on debian to download to a specific directory. Right now I'm using apt-get -d install packagename and then just fetch it in /var/cache/apt/archives/ but it would be nice if I could actually redirect the package to some other directory. Normally in ubuntu I would just do apt-get download but this option isn't available for me in debian.

share|improve this question Check the link. Check the cache option. – Raghunandan Apr 26 '13 at 18:25
apt-get gained the download command in Debian Wheezy which is not released yet (but is due to be released in the 1st quarter of May). Since Ubuntu builds on testing and unstable Debian archives its apt-get already has this command. – kostix Apr 28 '13 at 19:02
up vote 0 down vote accepted

The first comment to this answer solves your problem. That is, to fetch a package to the current directory you could do

apt-get -d -o dir::cache=`pwd` -o Debug::NoLocking=1 install package

One drawback which, I think, is still present is that it won't allow you to download a package which is already installed (even with --force) because this is the install command after all. At least this is what happens with my apt-get v0.8.10.3 from Debian Squeeze.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .