apt-offline fails to download requested upgrade files
https://askubuntu.com/questions/1566658/apt-offline-fails-to-download-requested-upgrade-files
Background: I am trying to revive a neglected 22.04.4 Ubuntu (Lubuntu, actually) machine that lost its network connectivity, presumably due to an upgrade effecting its Realtek PCIe Gbe network card. That's a common problem, lots of traffic on it. The solution is to downgrade the kernel, or, in my case, probably to upgrade it (most of the solutions written about it were written before there was a widely available patch). The only prior kernel patch I had available (I forget the number) failed to resolve the problem.
I am running apt-offline 1.8.5 on both the online and offline machines.
My problem isn't about the offline machine, but someone is bound to ask. The offline machine a dual boot machine. The network card works fine in Windows, and it also works fine when I boot off a live USB running 24.04, although that may be a generic driver. I'm assuming the problem's been fixed in the past two years.
The best solution seems to be apt-offline. The offline machine generates an update sig just fine, the online machine reads the update sig without issue, downloads a bunch of files and generates the desired update data. The offline machine reads the update data just fine and throws an appropriate number of green messages to the screen saying it has synced various sources. Producing the upgrade sig also looks like it proceeds normally.
The trouble comes when I try to get the data requested by the upgrade sig using the online machine. It cannot access a single file. Every one of them fails with a 403 Forbidden. The machine is connected. I am using it to write this message. It can get to the repos, because I have gone through the cycle s a few times with different options, and it can always get the upDATE information, just never the upGRADE information.
I took a look in in the upgrade sig file, copied all the source URLs into an HTML doc, and used a browser to download all of them (I was tired enough to give up on thinking but not tired enough to give up, so I just right clicked on all 320 odd links and downloaded them). Not a single one failed. It really doesn't look like a permissions issue. The URLs are reachable from the online machine and active. The file sizes are all correct.
I tried setting the cache to the folder I dumped the files to, but some of them (about 60) had names that were different from the downloaded basename and failed. The other 260 or so were zipped up into the target file successfully. I parsed the signature file and renamed all those files with basenames different from their handles in the sig file, but that had no effect (I suspect when the two names in the sig file are different, it uses some combination of the two, but includes only the basename in the verbose error messages, not what is is looking for in the cache).
The simplest thing is to figure out what's going on with the apt-offline download of the upgrade files, instead of trying to hack around it.
The command I used is:
sudo apt-offline get upgrade.sig --threads 5 --bundle upgrade.zip --verbose
A snippet (every single file looks like this) of the verbose output is (I reran it with --threads 1 to stop interleaved messages):
ERROR: Failed to download libatomic1
VERBOSE: Item before split is: 'http://security.ubuntu.com/ubuntu/pool/main/g/gcc-12/libquadmath0_12.3.0-1ubuntu1%7e22.04.3_amd64.deb' libquadmath0_12.3.0-1ubuntu1~22.04.3_amd64.deb 153976 MD5Sum:81479a10a57088dc284c55cbe3a96515
VERBOSE: Item after split is: 'http://security.ubuntu.com/ubuntu/pool/main/g/gcc-12/libquadmath0_12.3.0-1ubuntu1%7e22.04.3_amd64.deb' libquadmath0_12.3.0-1ubuntu1~22.04.3_amd64.deb 153976 MD5Sum:81479a10a57088dc284c55cbe3a96515
VERBOSE: Stripped item URL is: http://security.ubuntu.com/ubuntu/pool/main/g/gcc-12/libquadmath0_12.3.0-1ubuntu1%7e22.04.3_amd64.deb
VERBOSE: Stripped item FILE is: libquadmath0_12.3.0-1ubuntu1~22.04.3_amd64.deb
VERBOSE: Stripped item SIZE is: 153976
VERBOSE: Stripped item CHECKSUM is: MD5Sum:81479a10a57088dc284c55cbe3a96515
VERBOSE: Thread is Thread-1 (run)
Downloading libquadmath0 - 150 KiB
VERBOSE: http://security.ubuntu.com/ubuntu/pool/main/g/gcc-12/libquadmath0_12.3.0-1ubuntu1%7e22.04.3_amd64.deb - 403 - Forbidden
VERBOSE: Will still try with other package uris
ERROR: Failed to download libquadmath0
The procedure I used seemed straightforward, taken straight from many examples. I might be missing something super simple. I do the update and upgrade in separate steps, specifically to avoid the desynchronization issue I've seen mentioned. Obviously, I am copying the files between computers on a USB after each step.
On offline machine: sudo apt-offline set update.sig --update
On online machine: sudo apt-offline get update.sig --threads 5 --bundle update.zip
On offline machine: sudo apt-offline install update.zip
On offline machine: sudo apt-offline set upgrade.sig --upgrade
On online machine: sudo apt-offline get upgrade.sig --thread5 --bundle upgrade.zip
That last line is where it fails, and fails on every single file. The file upgrade.zip is empty (size 0). When I use the manually downloaded results to build a cache, I'm pretty sure it has data, but I don't think a partial update is a great idea.