What is the correct way to fix an assertion in loadlocale.c?

As easy as:

export LC_ALL=C

and then run your command. LC_ALL works as a fallback if something is not set (like LC_TIME in your case)


I had this problem on Ubuntu 14 trusty, I solved it as follows.

First, edit /etc/locale.gen and add the locales you want.

Make sure the utf8 in the locale name is lowercase, not e.g. UTF-8.

So mine are:

en_US.utf8
ru_RU.utf8

Now run, as root:

rm -f /usr/lib/locale/locale-archive
locale-gen --no-archive
locale-gen --no-archive en_US.utf8
locale-gen --no-archive ru_RU.utf8

the --no-archive flag is important.

Now make sure in your startup files like ~/.bash_profile and ~/.bashrc etc. you set LANG and related variables to the lowercase utf8 form, see the directories in /usr/lib/locale for the correct form.