Considering donating if you found my post helpful 😊
Contents
hide
Issue
I haven’t updated my Ubuntu server for a long time. When I tried doing that, I got a lot of locale error
locale: Cannot set LC_ALL to default locale: No such file or directory

Yep, a lot lines of them were produced in my terminal.
Solution
After a bit of searching, I found this solution that worked well
$ export LC_ALL="en_US.UTF-8" $ export LC_CTYPE="en_US.UTF-8" $ sudo dpkg-reconfigure locales
Execute them one by one, and yes, you need those export too. Without them, you will get another error like this
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_PAPER = "ms_MY.UTF-8",
LC_ADDRESS = "ms_MY.UTF-8",
LC_MONETARY = "ms_MY.UTF-8",
LC_NUMERIC = "ms_MY.UTF-8",
LC_TELEPHONE = "ms_MY.UTF-8",
LC_IDENTIFICATION = "ms_MY.UTF-8",
LC_MEASUREMENT = "ms_MY.UTF-8",
LC_TIME = "ms_MY.UTF-8",
LC_NAME = "ms_MY.UTF-8",
LANG = "C"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Hope this helps!
Considering donating if you found my post helpful 😊