apt-get -d download to a specific directory

11,050

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:
11,050

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    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.

    • Raghunandan
      Raghunandan about 11 years
      manpages.ubuntu.com/manpages/lucid/man1/apt-file.1.html. Check the link. Check the cache option.
    • kostix
      kostix about 11 years
      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.
  • Eric
    Eric over 5 years
    Can confirm that this won't download already-installed packages