5

When I go to internet cafe, I'd like to take that opportunity to upgrade the system. Sometimes though there is not electrical sockets in the cafe. To conserve batteries I'd like to be able to only do the "download" part of the upgrade process, and apply the new packages later, at home.

I know that I can just interrupt the apt-get dist-upgrade process just after it downloads the packages. I want to have a hands-free solution, that I can use in my custom download-all-upgrades.sh script.

It is possible to just download the package with aptitude, but it works only when I know the package name. It doesn't work with upgrade.

1 Answer 1

10

You can pass apt-get the -d option to only download the packages.

apt-get dist-upgrade -d

From man apt-get:

OPTIONS
    ...
    -d, --download-only
           Download only; package files are only retrieved, not unpacked or installed. Configuration Item: APT::Get::Download-Only.

From man aptitude

-d, --download-only

Download packages to the package cache as necessary, but do not install or remove anything. By default, the package cache is stored in /var/cache/apt/archives.

1
  • Anyone following this answer should know that Aptitude ignores the -d flag if it's used for an interactive session (i.e. aptitude -d alone).
    – ATLief
    Commented Jan 21, 2023 at 5:28

You must log in to answer this question.

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