J
J
Jekson2019-01-30 12:52:45
linux
Jekson, 2019-01-30 12:52:45

How to avoid the problem with locales when creating a new user?

When I try to add a new user from the console with the adduser username
command, I get an error:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
  LANGUAGE = (unset),
  LC_ALL = (unset),
  LC_PAPER = "be_BY.UTF-8",
  LC_ADDRESS = "be_BY.UTF-8",
  LC_MONETARY = "be_BY.UTF-8",
  LC_NUMERIC = "be_BY.UTF-8",
  LC_TELEPHONE = "be_BY.UTF-8",
  LC_IDENTIFICATION = "be_BY.UTF-8",
  LC_MEASUREMENT = "be_BY.UTF-8",
  LC_TIME = "be_BY.UTF-8",
  LC_NAME = "be_BY.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").
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX[_SYSTEM] configuration variable.  Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.

Help win, please!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2019-02-01
@Lepilov

When you SSH into the server, it copies the locale environment variables (LC_*), but the server may not have such a locale.
You can either add the locale on the server:
or explicitly set another one when starting the application ( there is always a C locale):
LC_ALL=C adduser username

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question