Offline apt-get update to age of cache
- by James Haigh
I have a script to quickly upgrade a Live or fresh system from cached files on a flash drive. In essence, it looks like this:
# *Code to remove and symlink /var/cache/apt/ if currently empty of packages.*
sudo apt-get dist-upgrade # Quick offline cached upgrade; not limited by slow WANs.
echo $'\nMake sure Internet is reachable and press enter for complete online upgrade.'; read
sudo apt-get update
sudo apt-get dist-upgrade # Complete online upgrade.
The problem is that the ‘cached upgrade’ seems to ignore the cached pkgcache.bin and srcpkgcache.bin which is where I assume apt-get update stores its changes, so the upgrade completes as if the system is up-to-date. Useless.
So in that case, I need some code to apt-get update to the age of the package cache on my flash drive. This code would be placed between the 1st and 2nd lines of the code above.