2

Everyday I am receiving an email with the following content:

/etc/cron.daily/man-db.cron: mandb: can't set the locale; make sure $LC_* and $LANG are correct 

When I check the results of of /etc/locale.conf, I see the result is set to

LANG=en_EN.UTF-8 

When I run the command locale I see the following output:

-sh-4.2$ locale LANG=nl_NL.UTF-8 LC_CTYPE="nl_NL.UTF-8" LC_NUMERIC="nl_NL.UTF-8" LC_TIME="nl_NL.UTF-8" LC_COLLATE="nl_NL.UTF-8" LC_MONETARY="nl_NL.UTF-8" LC_MESSAGES="nl_NL.UTF-8" LC_PAPER="nl_NL.UTF-8" LC_NAME="nl_NL.UTF-8" LC_ADDRESS="nl_NL.UTF-8" LC_TELEPHONE="nl_NL.UTF-8" LC_MEASUREMENT="nl_NL.UTF-8" LC_IDENTIFICATION="nl_NL.UTF-8" LC_ALL= 

Now I see that the LC_ALL is not set but when I set it using the following command:

-sh-4.2$ export LC_ALL=nl_NL.UTF-8 

and then run the command locale again

LC_ALL=nl_NL.UTF-8 

you will see that it is set but somehow when I go out of SSH and check sometime later, I will see again that it is not set and I keep receiving the email.

My question is, how can I solve the locale issue so I don't keep receiving the emails from man-db.cron.

I am using CentOS Linux release 7.1.1503 (Core).

2 Answers 2

1

In CentOS 7 you can use localectl status command to view the settings of your locale. If it is not set than use :-

# List locales localectl list-locales | grep en_EN # set your locale localectl set-locale LANG=en_EN.UTF-8 # also, set your local key map localectl set-keymap us localectl set-x11-keymap us 

Check your status again :- localectl status

0
1

I solved this on a Raspberry Pi 4 running Arch Linux by uncommenting en_US.UTF-8 UTF-8 in /etc/locale.gen and creating the files for that locale:

sudoedit /etc/locale.gen sudo locale-gen 

After that, man stops issuing this warning:

can't set the locale; make sure $LC_* and $LANG are correct

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.