4

When installing packages with apt-get, it first starts to download all needed packages and then installs them one by one.

But, If you interrupt the process during the first phase, and start over again, it downloads all packages again.

How can I continue the aborted download process without re-downloading the already received partial data?

  • 1
    @A.B. I think he wants to keep the partial downloads and just continue with downloading the rest. So that no data is downloaded twice. This might be useful for huge packages and people with slow connections. - I edited the question to sound like that. If I understood it falsely, please feel free to roll the edit back, rubo77! – Byte Commander Oct 27 '15 at 9:17
  • @ByteCommander It is exactly what apt-get does always! It never re-downloads partially downloaded data – Anwar Aug 14 '16 at 14:50
  • Now, as I read this again, I think so too, but I am sure, that, last year, when I asked this, I asked, because I was so unhappy, that it didn't keep the already downloaded parts in my case. Can you think of a setup, where id doesn't keep the partial downloads? – rubo77 Aug 14 '16 at 15:30
2

Your claim that

If you interrupt the process during the first phase, and start over again, it downloads all packages again.

is completely wrong! Apt is a smart package management system and it never re-downloads packages required to satisfy an installation request twice, not even for a single package or .deb file.

Those .deb files which are half-downloaded reside in /var/cache/apt/archives/partial directory and with ls command (in 16.04, you need to use sudo ls) you can check those files there.

You can verify this by looking at the apt-get manpage, where it says about /var/cache/apt/archives/partial/

  /var/cache/apt/archives/partial/
  Storage area for package files in transit. Configuration Item:
  Dir::Cache::Archives (partial will be implicitly appended)

You can even pick of one of those files and manually resume download using wget -c.

In the background, Apt uses wget program with -c switch, which from man-page means

-c,  --continue                  resume getting a partially-downloaded file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.