make sure $LC_* and $LANG are correct

mjw

Renowned Member
Jan 5, 2016
22
5
68
48
Hi everyone!

I installed my first Proxmox server and noticed that after a clean install, there is a problem with the locale configuration.

aptitude install something gives me the following:
Code:
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 = (unset),
    LC_ALL = (unset),
    LC_TIME = "de_AT.UTF-8",
    LC_MONETARY = "de_AT.UTF-8",
    LC_ADDRESS = "de_AT.UTF-8",
    LC_TELEPHONE = "de_AT.UTF-8",
    LC_NAME = "de_AT.UTF-8",
    LC_MEASUREMENT = "de_AT.UTF-8",
    LC_IDENTIFICATION = "de_AT.UTF-8",
    LC_NUMERIC = "de_AT.UTF-8",
    LC_PAPER = "de_AT.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory

Even 'man' tells me to set the variables.

I know I could fix this my self and there are multiple sites telling me how, but I feel this should not happen in the first place. Those variables should always be set to some sane default to avoid problems.

all the best,
mjw
 
Hi,
you are local on this machine or do you use ssh.
if you use ssh it is an ssh setting problem.
 
If you use ceph via ssh, its afaik an issue caused by it (its cosmetic and can be ignored - afaik fixed in infernalis)

If you do not feel like reading it every time you do something, the following will alleviate it:
Code:
nano /root/.bashrc

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

it will still pop up in your syslog tho if you run stuff from proxmox gui .
 
Thank you all!

I verified, that the message does not appear if I log in locally. So it's only about SSH logons.

'dpkg-reconfigure locales' does not solve the problem but throws warnings itself. In this example I tried to install "en_US.UTF-8" and make it the default locale.
Code:
root@vm5:~# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_PAPER = "de_AT.UTF-8",
    LC_ADDRESS = "de_AT.UTF-8",
    LC_MONETARY = "de_AT.UTF-8",
    LC_NUMERIC = "de_AT.UTF-8",
    LC_TELEPHONE = "de_AT.UTF-8",
    LC_IDENTIFICATION = "de_AT.UTF-8",
    LC_MEASUREMENT = "de_AT.UTF-8",
    LC_TIME = "de_AT.UTF-8",
    LC_NAME = "de_AT.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL 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)...
  en_US.UTF-8... done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "de_AT.UTF-8",
    LC_MONETARY = "de_AT.UTF-8",
    LC_ADDRESS = "de_AT.UTF-8",
    LC_TELEPHONE = "de_AT.UTF-8",
    LC_NAME = "de_AT.UTF-8",
    LC_MEASUREMENT = "de_AT.UTF-8",
    LC_IDENTIFICATION = "de_AT.UTF-8",
    LC_NUMERIC = "de_AT.UTF-8",
    LC_PAPER = "de_AT.UTF-8",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "de_AT.UTF-8",
    LC_MONETARY = "de_AT.UTF-8",
    LC_ADDRESS = "de_AT.UTF-8",
    LC_TELEPHONE = "de_AT.UTF-8",
    LC_NAME = "de_AT.UTF-8",
    LC_MEASUREMENT = "de_AT.UTF-8",
    LC_IDENTIFICATION = "de_AT.UTF-8",
    LC_NUMERIC = "de_AT.UTF-8",
    LC_PAPER = "de_AT.UTF-8",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
root@vm5:~#

The suggestion from Q-Wulf works (editing .bashrc) but I'm somewhat skeptical about it as Debian Wiki warns:
Using LC_ALL is strongly discouraged as it overrides everything. Please use it only when testing and never set it in a startup file.

I don't understand the details of this issue but shouldn't there be a clean solution to at least install the system in one language and make it work without warnings? Or maybe the warnings are the only issue and should just be suppressed?

Have a nice weekend! :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!