The problem I encounter with Debian bullseye (v11):
If I execute locale -a
, I get the following output:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
aa_DJ
aa_DJ.iso88591
aa_DJ.utf8
aa_ER
aa_ER.utf8
...
zh_TW
zh_TW.big5
zh_TW.euctw
zh_TW.utf8
zu_ZA
zu_ZA.iso88591
zu_ZA.utf8
Also, if I try to use tlmgr
(package manager for LateX), I get the following:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:fr:en_GB",
LC_ALL = "en-US.UTF-8",
LC_MESSAGES = "en_US.UTF-8",
LC_CTYPE = "en_US.UTF-8",
LC_COLLATE = "en_US.UTF-8",
LANG = "fr_FR.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("fr_FR.UTF-8").
tlmgr: no action given; try --help if you need it.
I searched the issue, and tried the following:
dpkg-reconfigure locales
and selecting only used locales (fr utf8, en-us utf8 and en-gb utf8)dpkg-reconfigure locales
and selecting all locales (as you can see above)locale-gen
- restarting the PC with each change
- editing /etc/default/locale
More information
cat /etc/default/locale
gives:
# File generated by update-locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
ls /usr/share/locale/en
gives:
LC_MESSAGES
ls /usr/share/locale/en/LC_MESSAGES
gives:
accounts-service.mo gtk30-properties.mo iso_3166-2.mo kcoreaddons5_qt.qm kwidgetsaddons5_qt.qm
cups-pk-helper.mo gtk30.mo
Questions
- Should I reconfigure locales and only select used locales?
- The error message says that it expects file/folder that does not exist. Where should this file/folder be located? in
/usr/share/locale/en
? - How to solve this issue (non-blocking, because all applications seem to work, but annoying)?
If you have suggestions for documentations to read to dive deeper on this issue I'm also all hear.
Thank you.
Edits
Questions from @StéphaneChazelas
Output of locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=fr_FR.UTF-8
LANGUAGE=en_US:fr:en_GB
LC_CTYPE="en-US.UTF-8"
LC_NUMERIC="en-US.UTF-8"
LC_TIME="en-US.UTF-8"
LC_COLLATE="en-US.UTF-8"
LC_MONETARY="en-US.UTF-8"
LC_MESSAGES="en-US.UTF-8"
LC_PAPER="en-US.UTF-8"
LC_NAME="en-US.UTF-8"
LC_ADDRESS="en-US.UTF-8"
LC_TELEPHONE="en-US.UTF-8"
LC_MEASUREMENT="en-US.UTF-8"
LC_IDENTIFICATION="en-US.UTF-8"
LC_ALL=en-US.UTF-8
Output of strace locale 2>&1 | grep ENOENT
:
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US.utf8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en-US/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
ls /usr/lib/locale
gives:
C.UTF-8
locale-archive
Strange dpkg-reconfigure locales output
If I'm not wrong, dpkg-reconfigure locales
should list locales and say for each of them "up to date" if already generated. But in my case, it re-process each locale and says "done":
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:fr:en_GB",
LC_ALL = "en-US.UTF-8",
LC_MESSAGES = "en_US.UTF-8",
LC_CTYPE = "en_US.UTF-8",
LC_COLLATE = "en_US.UTF-8",
LANG = "fr_FR.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("fr_FR.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
aa_DJ.UTF-8... done
aa_DJ.ISO-8859-1... done
aa_ER.UTF-8... done
aa_ER.UTF-8@saaho... done
aa_ET.UTF-8... done
af_ZA.UTF-8... done
af_ZA.ISO-8859-1... done
agr_PE.UTF-8... done
ak_GH.UTF-8... done
am_ET.UTF-8... done
an_ES.UTF-8... done
an_ES.ISO-8859-15... done
anp_IN.UTF-8... done
ar_AE.UTF-8... done
ar_AE.ISO-8859-6... done
ar_BH.UTF-8... done
ar_BH.ISO-8859-6... done
ar_DZ.UTF-8... done
ar_DZ.ISO-8859-6... done
ar_EG.UTF-8... done
ar_EG.ISO-8859-6... done
ar_IN.UTF-8... done
ar_IQ.UTF-8... done
...
Question by @K-att-
dpkg -l | grep "language-pack"
does not return anything.
Question from @ThatsWhatSheCoded
sudo apt-get install -y locales locales-all
:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
locales is already the newest version (2.31-13+deb11u2).
The following NEW packages will be installed:
locales-all
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 10.8 MB of archives.
After this operation, 227 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 locales-all amd64 2.31-13+deb11u2 [10.8 MB]
Fetched 10.8 MB in 21s (515 kB/s)
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_GB:en_US:fr",
LC_ALL = "en-US.UTF-8",
LC_CTYPE = "en_US.UTF-8",
LC_COLLATE = "en_US.UTF-8",
LC_MESSAGES = "en_US.UTF-8",
LANG = "fr_FR.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("fr_FR.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package locales-all.
(Reading database ... 182206 files and directories currently installed.)
Preparing to unpack .../locales-all_2.31-13+deb11u2_amd64.deb ...
Unpacking locales-all (2.31-13+deb11u2) ...
Setting up locales-all (2.31-13+deb11u2) ...
After restarting, locale -a
still gives:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
...
Print of env
after reinstalling locales
Executed: sudo apt-get remove locale
, then sudo apt-get install -y locales
and then env
:
SHELL=/bin/bash
WINDOWID=79691783
QT_ACCESSIBILITY=1
KDED_STARTED_BY_KDEINIT=1
COLORTERM=truecolor
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
LANGUAGE=en_GB:en_US:fr
SSH_AUTH_SOCK=/tmp/ssh-eAB2uCmvHnDY/agent.872
SHELL_SESSION_ID=08a2a2b1e969432881e34e2775568d69
DESKTOP_SESSION=plasma
SSH_AGENT_PID=911
GTK_RC_FILES=/etc/gtk/gtkrc:/home/nkoniishvt/.gtkrc:/home/nkoniishvt/.config/gtkrc
XCURSOR_SIZE=24
GTK_MODULES=gail:atk-bridge
XDG_SEAT=seat0
PWD=/home/nkoniishvt
XDG_SESSION_DESKTOP=KDE
LOGNAME=nkoniishvt
XDG_SESSION_TYPE=x11
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
XAUTHORITY=/home/nkoniishvt/.Xauthority
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/nkoniishvt/.gtkrc-2.0:/home/nkoniishvt/.config/gtkrc-2.0
HOME=/home/nkoniishvt
LANG=fr_FR.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_CURRENT_DESKTOP=KDE
KONSOLE_DBUS_SERVICE=:1.63
KONSOLE_DBUS_SESSION=/Sessions/1
PROFILEHOME=
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
KONSOLE_VERSION=201203
KDE_SESSION_UID=1000
XDG_SESSION_CLASS=user
TERM=xterm-256color
USER=nkoniishvt
COLORFGBG=15;0
KDE_SESSION_VERSION=5
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
DISPLAY=:0
SHLVL=1
LC_MESSAGES=en_US.UTF-8
XDG_VTNR=7
XDG_SESSION_ID=3
LC_CTYPE=en_US.UTF-8
XDG_RUNTIME_DIR=/run/user/1000
LC_ALL=en-US.UTF-8
QT_AUTO_SCREEN_SCALE_FACTOR=0
LC_COLLATE=en_US.UTF-8
XCURSOR_THEME=breeze_cursors
KDE_FULL_SESSION=true
PATH=/home/nkoniishvt/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
KDE_APPLICATIONS_AS_SCOPE=1
KONSOLE_DBUS_WINDOW=/Windows/1
_=/usr/bin/env
locale
and ofstrace locale 2>&1 | grep ENOENT
?export LANGUAGE=en_GB:en_US:fr
from your.bashrc
thendpkg-reconfigure locales