Annoying warning message in Debian Lenny: perl: warning: Setting locale failed.

Everytime I setup a Debian server and install some software using apt-get I will get an error message like this:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

It seems to be harmless but it is very annoying.  After a quick search I found a solution to the problem.  Simply install locales if it isn't installed already and then configure locales.

# apt-get install locales
# dpkg-reconfigure locales

After doing that then the messages should be gone.  Yay!

BTW, Don't forget to do a

BTW, Don't forget to do a apt-get update and apt-get upgrade first!