How apt.

As I’ve mentioned previously, I’ve upgraded my laptop to Ubuntu Dapper. I run apt-proxy on the LAN file server to improve the speed of distributing updates to computers. I set up Ubuntu repositories on it for the first time a couple of nights ago, in readiness for Dapper’s release in a week’s time.

One of the reasons I’d not set up Ubuntu repositories on apt-proxy before is that I’d basically stopped using it back when I was running Debian on the desktop and laptop. When I took my laptop off the LAN, it was a pain to have to reconfigure /etc/apt/sources.list to tell it to use proper Debian repositories. I then had to reconfigure it to use the apt-proxy when I brought it back on the network. Or, more likely, I couldn’t be bothered and would end up continuing to use the repositories direct, and not benefitting from having an apt-proxy at all.

As we have currently three machines (and several virtual machines) running Ubuntu, I thought I should start using apt-proxy again. But I still wanted a way to get round the laptop problem. Could apt be configured to use the apt-proxy if it was available but failover to the proper repositories otherwise? Apparently it can’t. “yum”, the apt-like tool on Fedora systems, can do exactly this. If a file isn’t available on one mirror (or the checksum fails) it can fail over to an alternative mirror. But ol’ apt can’t.

However, apt-proxy itself does support this behaviour. Multiple backends can be defined for each virtual repository that it offers to clients. So, I installed apt-proxy on my laptop too. Configured it to listen on localhost only, and to use the apt-proxy on the LAN as the first port of call and the main Ubuntu repositories as a fallback. So this should provide transparent failover, which is exactly what I wanted.

I also looked at approx as an alternative to apt-proxy because it has fewer dependencies, but it doesn’t support multiple backends at the moment.

Be Sociable, Share!
    Pin It

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Comment Spam Protection by WP-SpamFree