I have recently updated Ubuntu to 18.04. After this, issuing the command ld constantly failed with the following assertion:

loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.

I have googled this problem and it looks like this is a well known issue. All of the solutions that I have read suggested fixing this using the following command:

export LC_ALL=C

See, for example, this one. However, doing so breaks fonts of the commentaries on my native language in VIM for example.

So, this solution is not suitable for me-. Are there any other ways to fix this issue?


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)

  • Why has this received any upvotes whatsoever? This is the "solution" (or shall we say workaround) mentioned by the person asking. And there is a rationale as to why this workaround doesn't work. Dec 15 '20 at 20:10

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:


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.

  • This worked for me on Ubuntu 18.04 but with the following modifications: 1. use en_US.UTF-8 UTF-8 in locale.gen 2. then locale-gen --no-archive en_US.UTF-8
    – Alex T
    May 7 '20 at 21:36

I added this to my .bashrc and it fixed the issue for both Ubuntu 18 and 20 when I was having that same message with an old 32 bit gdb for an Arm cross compiler

export LANG=C

  • be warned, a side effect is this changes the order of sort
    – jozxyqk
    May 3 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.