The context is a bug in which Ubuntu are updating package list timestamps every 30 minutes on their archive mirrors, which forces [apt-get|aptitude] update
commands to download package lists though they haven't changed:
The proposed workaround is to run touch
over the affected index files prior to running apt-get update
. This make their timestamps current, and avoids having to re-download them. This speeds processing by up to several minutes (2-3 seconds vs. 2-6 minutes in various tests). This despite running a local apt-cache-ng
proxy.
We're running into this testing (mostly) and deploying (somewhat) Ubuntu-based images for our AWS infrastructure in which apt-get update
runs a couple of times. 3-6 minutes vs. 3-20 seconds makes a big difference in our iteration time.
It seems odd to me that apt doesn't rely on filesize or hashes to determine whether or not files have changed. Timestamps are very trivially modified, and seem awfully brittle to base this behavior on.
apt-get update
every thirty seconds, so I don – Jun 28 '12 at 21:43