As far as I understand, I am NOT setting "permanently" any locale- related environment variable: I am not storing in any file the settings for LC_ALL and LANG variables.
My proposed workaround to recover the installation uses two "safety nets": 1) regenerate the locale-archive 2) sends "C" environment variables to apt-get or dpkg-reconfigure so that they operate (just once) on the default locale and don't do weird things if, for whatever unknown reason, the system locale gets corrupted while reconfiguring 1000 broken packages. After these "safety nets" are used once, rebooting the system gets a perfectly working installation and there is no need of any more LANG or LC_ALL overrides. The standard "language support" is what I first tried to execute time ago, when trying to find workarounds for the first reported abnormal behaviour (the first posts). However, as the system was broken, the language support window did not even show up. Fortunately, the one-time locale override restored the system. Indeed, afterwards standard language support worked flawlessly. However, from time to time, specially on release upgrades, the locale file breaks and the workaround needs to be applied (just once) to avoid the risk of rebooting on a broken system. In order to provide further information with might be relevant (or not), here are some links: Some related situations arising from (maybe) the locale corruption bug at stake: http://askubuntu.com/questions/33025/locale-settings-are-not-right-how-can-i-reset-them http://serverfault.com/questions/301896/how-to-fix-locale-settings-in-debian-squeeze Issues date from 2008 at least: http://www.esdebian.org/foro/24875/problema-locales and there is the origin of my inspiration to run scripts with LC_ALL="C" as a safe-mode workaround. Some other people with the Spanish locale had these issues: http://tech.enekochan.com/tag/ubuntu/?lang=es Some other people reports locale corruption during updates in other distros: https://bbs.archlinux.org/viewtopic.php?id=130772 I wonder if the strange locale name ca_ES.utf8@valencia breaks something (for instance, the @valencia stuff broke libreoffice https://bugs.freedesktop.org/show_bug.cgi?id=58417) Seems that sed / awk may get disoriented with some locales or corruption, so for instance here they recommend using LC_ALL=C before invoking sed: http://www.sourceware.org/ml/libc- alpha/2013-03/msg00258.html In summary, locale-archive gets corrupted. None of the link seems to indicate "when" it does get corrupt, however. The fallback locale LC_ALL="C" helps scripts with sed, awk, grep, etc. suceed in case of corruption. If other people had the same problems, maybe adding LC_ALL="C" to some installation scripts might bullet-proof them against this bug (or, at least, retrying if upgrade fails). ** Bug watch added: freedesktop.org Bugzilla #58417 https://bugs.freedesktop.org/show_bug.cgi?id=58417 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/663694 Title: apt-get fails with LANG=es_ES.utf8, succeeds with LANG=C To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/langpack-locales/+bug/663694/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs