I've bought a new laptop DELL Inspiron i3 5th gen 3000 series. On my first login, even before restarting, I tried to apply updates and I got the error

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

It was so nagging to see this because I was using a Compaq laptop earlier and I had the same error, which I could never fix.

  • 1
    Did you install Ubuntu yourself or was it pre-installed? Anyway, can you please open a terminal window, run the locale command, and show us the complete output by editing your question. Feb 9, 2017 at 23:48

3 Answers 3


Insert into /etc/default/locale:


And regarding the missing locales, to generate them: sudo dpkg-reconfigure locales

  • 3
    Rather than commenting, edit your post to add the information.
    – user423626
    Mar 16, 2017 at 9:14
  • 1
    willdo next time
    – Galvani
    Mar 17, 2017 at 11:15

This one worked for me.

sudo -i
export LANGUAGE=en_US.UTF-8; export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; locale-gen en_US.UTF-8
dpkg-reconfigure locales

This worked for me (On Ubuntu 14.04 - but probably works on other systems)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.