+4 votes
in Databases by (40.5k points)

When I run "apt upgrade" command on my new VPS, it gives the following error messages:

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

The VPS has Debian 10 Linux OS. How can I fix this error?

1 Answer

+1 vote
by (346k points)
selected by
 
Best answer

You need to configure the locale before upgrading the packages.

  • Type the following command on the terminal:

sudo dpkg-reconfigure locales

  • The command will bring a pop-up window; using arrow key, scroll down, and select "en_US.UTF-8" by pressing the "Space bar". You will see a star (*) mark before "en_US.UTF-8" after pressing the "Space bar". Using the tab button, go to "Ok" and hit Enter.
Configure locales on Linux
  • It will reconfigure locales and the issue should be fixed.

...