How to fix locales in Debian/Ubuntu Linux VPS

Written By
Web Webster
Web Webster
Jun 2, 2016

In the following article we’ll show you how to fix missing or improperly installed locales on a Debian or Ubuntu Linux VPS.

What are Locales?
Locales are used by glibc and other locale-aware programs or libraries for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards. They define language and country specific setting for your programs and shell sessions.

Show current locale settings in Linux VPS
To display the currently set locales and its related environmental setting in Debian or Ubuntu based linux vps you can use the command below:

locale
To show all available locales in your linux virtual server, run the following:

locale -a
Fixing Locales
Usually, locales on your linux vps may not be properly setup for many reasons and you may be getting the following errors while performing random tasks on the linux shell:

Advertisement

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “ar_LY.UTF-8”,
LC_MONETARY = “ar_LY.UTF-8”,
LC_ADDRESS = “ar_LY.UTF-8”,
LC_TELEPHONE = “ar_LY.UTF-8”,
LC_NAME = “ar_LY.UTF-8”,
LC_MEASUREMENT = “ar_LY.UTF-8”,
LC_IDENTIFICATION = “ar_LY.UTF-8”,
LC_NUMERIC = “ar_LY.UTF-8”,
LC_PAPER = “ar_LY.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 = “ar_LY.UTF-8”,
LC_MONETARY = “ar_LY.UTF-8”,
LC_ADDRESS = “ar_LY.UTF-8”,
LC_TELEPHONE = “ar_LY.UTF-8”,
LC_NAME = “ar_LY.UTF-8”,
LC_MEASUREMENT = “ar_LY.UTF-8”,
LC_IDENTIFICATION = “ar_LY.UTF-8”,
LC_NUMERIC = “ar_LY.UTF-8”,
LC_PAPER = “ar_LY.UTF-8”,
LANG = “C”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
To fix this, you need to execute the following commands:

apt-get install language-pack-en

localedef -v -c -i en_US -f UTF-8 en_US.UTF-8

export LANG=en_US
export LC_ALL=C

locale-gen $LANG
echo LANG=$LANG /etc/environment
echo LC_ALL=$LC_ALL /etc/environment

dpkg-reconfigure locales
If you’re one of our Linux VPS Hosting customers we can help you fix your locales on your virtual server free of charge. Just contact us and some of our experts will complete your request immediately.

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.