If you are trying to use the perl
command in your terminal or execute a script coded in the language, you may encounter the Falling back to the standard locale
error. This indicates that your Linux system is missing a particular software package that Perl relies on, or the software has become corrupted or misconfigured. In this tutorial, we will show you how to remedy the error and get your perl
command working again.
In this tutorial you will learn:
- How to fix the
Falling back to the standard locale
error message on all major Linux distros

Category | Requirements, Conventions or Software Version Used |
---|---|
System | Any Linux distro |
Software | perl, locales |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
Falling back to the standard locale – Solution
The error occurs when trying to execute a Perl script or just using the
perl
command in terminal. It looks like this:
perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").
The problem is that your system’s locale is not set. You may be missing the software entirely or just have not configured the locale. This message may appear for example when you are installing new packages into your Linux system. Fortunately, there is an easy fix to this problem.
Depending on which Linux distro you are using, follow the appropriate set of instructions below to remedy this error.
Debian-based and Ubuntu solution
For systems based on Debian Linux, including Ubuntu.
- First make sure that you have the
locales
package installed:$ sudo apt update $ sudo apt install locales
The previous command will install locales package or it will output that locales is already installed.
- Next, use the
dpkg-reconfigure
command to configure the locales package.$ sudo dpkg-reconfigure locales
- Use the menu that shows up to reconfigure your locales. For example,
en_US.UTF-8 UTF-8
for English speaking Americans. Pick the appropriate one for you.Configuring the locale on Ubuntu
RHEL-based and Fedora Solution
For systems based on Red Hat, including Fedora, CentOS, and AlmaLinux.
- First, search for the appropriate language pack inside of the official software repositories:
$ dnf search langpacks-
- Once you find the right one, install it with
dnf
. For example, English speakers would needlangpacks-en
.$ sudo dnf install langpacks-en
- Next, use the following command to list all of the locales available on your system.
$ localectl list-locales
- Once you have identified the proper one for your system, set your locale with the
localectl set-locale
command. In our case, we will set our locale toen_US.UTF-8
.$ sudo localectl set-locale en_US.UTF-8
Arch Linux based and Manjaro
For systems based on Arch Linux, including Manjaro.
- Open the
/etc/locale.gen
in nano or your favorite text editor.$ sudo nano /etc/locale.gen
- Uncomment the locale that you wish to use on your system, and make sure others are commented out if you do not plan to use them. Save the changes when you are done with your edits
Setting the locale on Manjaro - For these changes to take effect, run the
locale-gen
command.$ sudo locale-gen
Closing Thoughts
In this tutorial, we saw how to resolve the
perl: warning: Falling back to the standard locale
error message on a Linux system. Having your locale misconfigured or unset on Linux will cause problems with Perl, which may manifest as errors during package installation and other ordinary terminal tasks. The instructions here cover all major Linux distros, so you can get Perl working again regardless of what type of Linux system you are running.