0

I am trying to upgrade Ubuntu in stages, I want to first download all the required packages and only then start the upgrade.

So, I downloaded required debian packages and copied them to /var/cache/apt/archives (before doing a dist-upgrade). But still, I see that apt tries to Get: (download) the packages.

If the cache were hit, it should have shown Hit: correct ? Is there any way to know if apt is looking for packages in some other location ? Also, is there an option to force apt to always look in the cache before trying to download?

Ani
  • 32
  • 2
  • 13
  • I am not using `rsync` here. I just download the required packages on another machine and copy it to the one to be upgraded (and place them in `/var/cache/apt/archives`). – Ani Aug 17 '21 at 15:49
  • @vyom that IS the point. You are using a standard tool to copy, but anx believes the timestamps matter, so you might NEED to use rsync. I would be tempted to try using rsync, I don't know if timestamps matter. – Zoredache Aug 17 '21 at 16:17
  • 1
    There are other things that could have gone wrong.. such as missing dependencies or mismatched versions in the files you downloaded. The output with `--dry-run` might tell.. – anx Aug 17 '21 at 16:30
  • 2
    if you prefer to download why not install `apt-cacher-ng` on that machine and use it as proxy? – djdomi Aug 17 '21 at 16:52
  • ok, I will try `dry-run` – Ani Aug 17 '21 at 17:00
  • Please include the output from `apt dist-upgrade` and `ls -al /var/cache/apt/archives` – Matt Zimmerman Sep 03 '21 at 17:20
  • Due to some environment settings, `apt` was looking under `/var/cache/apt/archives/archives`! A subdirectory under archives! I've resolved it now. Thank you all for suggestions. – Ani Sep 04 '21 at 18:05
  • 1
    @vyom If your problem is solved, please write an answer (not just a comment). On this site, you can and are in fact encouraged to also mark your own answers as "accepted" if they were the most useful. – anx Sep 11 '21 at 17:38
  • FWIW, you can also use `apt -d upgrade` to perform the download only. – Simon Richter Sep 17 '21 at 10:53

1 Answers1

0

Due to some environment settings, apt was looking under /var/cache/apt/archives/archives ! (a subdirectory under archives) I had to reset the environment, and then it worked. Thank you all for suggestions.

Ani
  • 32
  • 2
  • 13