Speeding up a very slow apt-get update

If your laptop hard disk is so slow it sometimes seems like it would be faster to write the ones and zeros with a pencil on paper, a large apt-get update can take hours.

I have found most of the time is actually spent in /sbin/ldconfig. ldconfig is extremely disk intensive and a real bottle neck, and really only needs to be run once once you've finished, rather than every time a library is installed. Replacing ldconfig with a stub makes update times much more tolerable.

#!/bin/bash

exit 0

I think there has been some talk of apt being smart enough to only do it once for you, but current versions don't seem to implement this. When you're finished restore the old (real) binary and run it to update your shared library cache.