Tags

, , ,

Install a fresh instance of Ubuntu and you will most likely get that infuriating LC_ALL locale warnings whenever you use anything that invokes the Perl Interpreter. Why does it happen, and how do you fix it quickly?

It happens because a base install of Ubuntu, generated from disk image, which is the usual way cloud and VPS providers distribute OS packages, avoid making assumptions about my ethnicity and language of choice, that’s something they leave up to me to install myself. We don’t have nice little install wizards to select our language preferences. They make the assumption that I’m not a numbskull who just wants life to be relatively convenient and hassle-free – a rather poor assumption on their part! Fixing it is easy:

> sudo apt-get install language-pack-en-base
> sudo dpkg-reconfigure locales

And that’s all you have to do. No messing around trying to set environment variables or any of that nonsense. Just install the language pack of your choice and reconfigure the locales. If you are installing a French server language-pack-fr-base I would assume would work, etc.

To test everything is fixed just run “perl -v” and it should just print the version info with no warnings.