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:
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:
Now run, as root:
the
--no-archive
flag is important.Now make sure in your startup files like
~/.bash_profile
and~/.bashrc
etc. you setLANG
and related variables to the lowercaseutf8
form, see the directories in/usr/lib/locale
for the correct form.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