Error “trid: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME))' failed” (SOLVED)
September 1, 2021
When running this or that command, you may encounter an error in which the word “loadlocale.c” appears. You can report this bug to the author so that he can fix it, as it is more of a program bug. However, there are several ways to fix this error.
As you can tell from the “locale” string, the error is locale-related.
An example of an error:
trid: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME))' failed. Aborted (core dumped)
The most common advice is to run before the command:
And then execute the command that caused the error – the error should disappear.
But this tip can break fonts in some other applications. Therefore, use this method with LC_ALL as a fallback if something is not set (as in the case above, this is LC_TIME).
Another tip is to do the following:
and then run the problematic command – that should work as well. This may have fewer side effects on fonts in other languages.
It also offers a way to fix this problem on a permanent basis – handy if you frequently run the command causing an error with loadlocale.c.
First, edit the /etc/locale.gen file and add the locales you want.
For example, in my case:
en_US.UTF-8 UTF-8 ru_RU.UTF-8 UTF-8
Now run as root:
sudo rm -f /usr/lib/locale/locale-archive sudo locale-gen --no-archive sudo locale-gen --no-archive en_US.UTF-8 sudo locale-gen --no-archive ru_RU.UTF-8
The --no-archive flag is important, use it as shown in the commands.
- How to change Linux language without reinstalling my OS (98.5%)
- Analogue of the --force option in pacman (51.5%)
- How to downgrade to a previous kernel in Arch Linux (51.5%)
- bash: finger: command not found in Arch Linux (RESOLVED) (51.5%)
- How to choose the default Java version in Arch Linux (51.5%)
- Error “Authentication helper program /usr/lib64/squid/basic_ncsa_auth: (2) No such file or directory” (SOLVED) (RANDOM - 51.5%)