After setting up apt-cacher on our home server and setting all our other computers to use it as a proxy caching service, we found that apt-get update and Update Manager always fails while fetching Translations.
Get:5 http://au.archive.ubuntu.com intrepid/main Translation-en_AU [2734B] Ign http://mirror.files.bigpond.com intrepid/restricted Translation-en_AU Err http://mirror.files.bigpond.com intrepid/universe Translation-en_AU Error reading from server - read (104 Connection reset by peer)
According to the debian-bugs-dist, Bug#517761:
apt-cacher: Translation-en_US.bz2 fails when LANG on client not equal to LANG on server
To avoid this problem, you can run apt-get update and pass the LANG variable to it:
sudo LANG=C apt-get update
As a single apt-cacher service can handle requests for multiple apt based distros, it seems odd that it will not cross the LANG barrier and so I had a go at seeing what could be done to stop apt updates from failing.
Not wanting to try and configure every computer to avoid this error, I decided to look on the server for the apt-cacher config file and the very last section looked interesting.
/etc/apt-cacher/apt-cacher.conf
# Permitted Index files - this is the perl regular expression which matches all # index-type files (files that are uniquely identified by their full path and # need to be checked for freshness). #The default is: #index_files_regexp = (?:Index|Packages\.gz|Packages\.bz2|Release|Release\.gpg|Sources\.gz|Sources\.bz2|Contents-.+\.gz|pkglist.*\.bz2|release|release\..*|srclist.*\.bz2|Translation-.+\.bz2)$
By un-commenting and editing the last line, we can tell apt-cacher that Translation index files are not permitted:
index_files_regexp = (?:Index|Packages\.gz|Packages\.bz2|Release|Release\.gpg|Sources\.gz|Sources\.bz2|Contents-.+\.gz|pkglist.*\.bz2|release|release\..*|srclist.*\.bz2)$
I am unsure of the implications that may arise by not permitting apt-cacher Translation index files, but so far apt-get update and update manager are no longer complaining.
3 responses so far ↓
pat5star // Sep 14th 2009 at 5:29 am
Thanks for posting this. I’ve wasted a couple of hours trying to figure out what’s been going on with my small home/office network and your article here came up in a google search…in 4th or 5th place. Yours was the 1st one with a suggestion that worked for me though!
I don’t have the index_files_regexp option in my apt-cacher.conf file. I’m wondering if that’s a difference between OS’s as I’m using Kubuntu and assuming you’re using Debian. Hopefully this will be fixed soon but in the meantime this will have to do:
sudo LANG=C apt-get update
Thanks again for posting this…it saved the day and now allows me to download and experiment with Karmic Koala (Kubuntu 9.10), which is what I was attempting earlier and started this whole mess. If I didn’t have to change my sources file in order to upgrade, I may not have discovered the problem for quite awhile…as my updates are done nightly through cron and output is sent to the bit bucket. I now see that I should rethink that whole setup because I have no idea how long this problem has existed!
Martin // Sep 14th 2009 at 8:25 am
Thank you for your comment.
I have just checked what version of apt-cacher I am currently using.
Ubuntu Jaunty
apt-cacher 1.6.7ubuntu4I wouldn’t think there would be much difference between the Debian and*buntu versions, maybe try and add the extra line to the apt-cacher config and see if it works for you.
Feel free to let me know if it works or not.
Tom // Mar 6th 2010 at 5:00 pm
This appears to be a good fix for this problem. I’m using 1.6.8ubuntu1 (in Karmic) and it fixed things for me as well.
Apparently the REAL fix is to ensure that all of your machines have the same exact locale set, but since all of mine are exactly the same this is much simpler
Leave a Comment