Celeb Glow
updates | March 22, 2026

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

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?

3 Answers

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)

1

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.

1

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

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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