zypper dup gives /usr/bin/manpath: can't set the locale; make sure $LC_* and $LANG are correct

Hi there,

when running my daily zypper dup, I frequently get this warning:

/usr/bin/manpath: can’t set the locale; make sure $LC_* and $LANG are correct

Everything works fine though, so this is just a little annoyance. Here is
my locale output:

LANG=POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=“POSIX”
LC_TIME=“POSIX”
LC_COLLATE=“POSIX”
LC_MONETARY=“POSIX”
LC_MESSAGES=“POSIX”
LC_PAPER=“POSIX”
LC_NAME=“POSIX”
LC_ADDRESS=“POSIX”
LC_TELEPHONE=“POSIX”
LC_MEASUREMENT=“POSIX”
LC_IDENTIFICATION=“POSIX”
LC_ALL=

Any ideas?

TIA

I don’t look closely at output from “zypper dup”.

I do keep a transcript of the most recent run, but I did not find “manpath” mentioned there.

Locale settings are per-user (actually per-process) so what matters is locale settings when this program runs, not locale settings in your (unknown) user interactive session.

Check /var/log/zypp/history, this output should be recorded there. It should provide information what package invokes this command, then we could look at scripts this package runs during update.

Sorry, I run zypper as root and this was the locale of my root user. But here is where I need some help:

If I su to root:

arne@Arnes-PC:~> su -
Password:
Arnes-PC:~ # locale
LANG=POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=“POSIX”
LC_TIME=“POSIX”
LC_COLLATE=“POSIX”
LC_MONETARY=“POSIX”
LC_MESSAGES=“POSIX”
LC_PAPER=“POSIX”
LC_NAME=“POSIX”
LC_ADDRESS=“POSIX”
LC_TELEPHONE=“POSIX”
LC_MEASUREMENT=“POSIX”
LC_IDENTIFICATION=“POSIX”
LC_ALL=

But if I just do

arne@Arnes-PC:~> sudo 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=en_DE.UTF-8
LC_CTYPE=“en_DE.UTF-8”
LC_NUMERIC=en_DE.UTF-8
LC_TIME=en_DE.UTF-8
LC_COLLATE=en_DE.UTF-8
LC_MONETARY=en_DE.UTF-8
LC_MESSAGES=“en_DE.UTF-8”
LC_PAPER=“en_DE.UTF-8”
LC_NAME=“en_DE.UTF-8”
LC_ADDRESS=“en_DE.UTF-8”
LC_TELEPHONE=“en_DE.UTF-8”
LC_MEASUREMENT=en_DE.UTF-8
LC_IDENTIFICATION=“en_DE.UTF-8”
LC_ALL=

I get the same error as running sudo zypper dup. How can I fix this?

Please use Code-Tags:
https://forums.opensuse.org/showthread.php/536143-Using-Code-Tags-Around-Your-Paste

Sorry, next time. Cannot edit that post anymore.

Such locale does not exist. Post output of

env | grep -E 'LANG|LC_'
sudo -s
env | grep -E 'LANG|LC_'

What desktop environment are you using?

I am running KDE.

**Arnes-PC:/home/arne #** env | grep -E 'LANG|LC_' 
**LANG**UAGE= 
**LANG**=POSIX 
**LC_**CTYPE=en_US.UTF-8 
**Arnes-PC:/home/arne #** sudo -s 
**Arnes-PC:/home/arne #** env | grep -E 'LANG|LC_' 
**LANG**UAGE= 
**LANG**=POSIX 
**LC_**CTYPE=POSIX

Do I need to set these?

Not executed as root:

Arnes-PC:/home/arne #

As User.

stephan@linux64:~> env | grep -E 'LANG|LC_'
LC_MEASUREMENT=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LANG=de_DE.UTF-8
LC_COLLATE=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LANGUAGE=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
stephan@linux64:~>

stephan@linux64:~> sudo -s
[sudo] Passwort für root: 
linux64:/home/stephan # env | grep -E 'LANG|LC_'
LANG=POSIX
LC_CTYPE=de_DE.UTF-8
LANGUAGE=de_DE.UTF-8
linux64:/home/stephan #

Thanks, LANG and LANGUAGE is missing in my environment. Just wondering, what might be the best place to set them. I can’t find anything in .bashrc, /etc/bash.bashrc, .profile, /etc/profile.
Is there any preference, where these should be set?

See “man localectl” to set it globally. Setting it in ~/.profile will do it at login.

Gene

Thanks, I tried it, but it is not getting much better now.

I did some more research and found hints, that maybe some parts of the system do not work well with my en_DE locale.
So I decided to switch to de_DE. I changed my KDE Settings to German as my primary language and also in Yast. Also I used

localectl set-locale LANG=de_DE.utf8
localectl set-locale de_DE.utf8

I wasn’t sure, which one is right, so I tried both. locale.conf looks good:

**Arnes-PC:~ #** cat /etc/locale.conf
LANG=de_DE.utf8

But after a reboot, I am still on en_DE:

arne@Arnes-PC:~> env | grep -E 'LANG|LC_'      
**LANG**UAGE=de:en_US 
**LC_**MONETARY=en_DE.UTF-8 
**LANG**=en_DE.UTF-8 
**LC_**MEASUREMENT=en_DE.UTF-8 
**LC_**TIME=en_DE.UTF-8 
**LC_**COLLATE=en_DE.UTF-8 
**LC_**NUMERIC=en_DE.UTF-8 
arne@Arnes-PC:~> cat .profile | grep LANG 
# in the variable RC_**LANG**. 
#export **LANG**=de_DE.UTF-8        # uncomment this line for German output 
#export **LANG**=fr_FR.UTF-8        # uncomment this line for French output 
#export **LANG**=es_ES.UTF-8        # uncomment this line for Spanish output 
arne@Arnes-PC:~> cat .bashrc | grep LANG        
# here, since multilingual X sessions would not work properly if **LANG** is over- 
arne@Arnes-PC:~>  
arne@Arnes-PC:~> sudo env | grep -E 'LANG|LC_' 
[sudo] password for root:  
**LANG**UAGE=de:en_US 
**LC_**MONETARY=en_DE.UTF-8 
**LANG**=en_DE.UTF-8 
**LC_**MEASUREMENT=en_DE.UTF-8 
**LC_**TIME=en_DE.UTF-8 
**LC_**COLLATE=en_DE.UTF-8 
**LC_**NUMERIC=en_DE.UTF-8 
arne@Arnes-PC:~> sudo su - 
**Arnes-PC:~ #** env | grep -E 'LANG|LC_' 
**LANG**=POSIX 
**LC_**CTYPE=de_DE.utf8 
[FONT=monospace]**Arnes-PC:~ #** cat /etc/profile | grep LANG[/FONT]
[FONT=monospace]**Arnes-PC:~ #**[/FONT]

Any ideas how I can get to a consistent de_DE locale?

en_DE is no locale…
only de_DE or en_EN…

https://www.tecmint.com/set-system-locales-in-linux/

For the second time - what desktop environment are you using? Do you observe the same if log in on console? Press Ctrl-Alt-F3, login, check locale.

I am using KDE. In console, everything is fine. So this is a problem with my KDE conf?

OK, in my KDE System Settings, Formats everything is set to en_DE. There is no Option to change it to de_DE.

OK, in my KDE System Settings, Formats everything is set to en_DE. There is no Option to change it to de_DE.

What is set in Language (Sprache)?
You can add there other languages

https://www.krauttranslate.de/~sauerland/Sprache%20%20—%20Systemeinstellungen_001.png

https://www.krauttranslate.de/~sauerland/Formate%20-%20—%20Systemeinstellungen_001.png

https://www.krauttranslate.de/~sauerland/Formate%20%20—%20Systemeinstellungen_001.png

Here are my settings. For German I only can choose en_DE, there is no de_DE option.

For whatever reason, the option to choose de_DE locale has been back again and I have selected it. Unfortunately, I already did my daily zypper dup, so I need to wait until tomorrow until I can check if that helped.