55

Using system settings I changed my language to Arabic and deleted the English language from the settings. Then the computer lagged and it logged out - now I can't log back in because the login is in Arabic.

So is there a way to default my language via terminal, default the login password language, or login via terminal which is still in English. I only have access to guest and a terminal.


I changed the pasword to something that could be translated into arabic http://www.psychocats.net/ubuntu/resetpassword - then loged in and used system settings to default.

Luis Alvarado
  • 209,003
  • 167
  • 543
  • 707
McGee
  • 551
  • 1
  • 4
  • 3

3 Answers3

60

Edit two files:

  1. sudoedit /etc/default/locale:

    LANG="en_US"
    LANGUAGE="en_US:en"
    
  2. sudoedit ~/.pam_environment:

    LANG=en_US
    LANGUAGE=en_US
    

Logout and Login or Reboot.

Zanna
  • 69,223
  • 56
  • 216
  • 327
harisibrahimkv
  • 7,216
  • 11
  • 44
  • 71
  • 5
    Nano is also installed by default. :-) – LiveWireBT May 07 '12 at 17:29
  • 3
    If you want to understand what changing these variables means: https://help.ubuntu.com/community/Locale – yuric Apr 29 '13 at 17:25
  • 4
    Also need `LC_ALL=en_US.UTF-8` – Artem P Jan 19 '16 at 00:28
  • 3
    If using KDE, you might want to check `~/.KDE/env/setlocale.sh` too, as it might conflict. – stragu Jun 22 '16 at 04:15
  • 2
    This also works for "Bash on Ubuntu" on Windows 10. –  Oct 18 '16 at 06:46
  • 2
    @hlcs You shouldn't set `LC_ALL` in `/etc/default/local`, and definitely shouldn't need it. `LC_ALL` prevents you from using fine grained control of `LC_*` vars. Users / apps would need to `unset LC_ALL` to do this. On the other hand `LANG` sets the defaults for all the `LC_*` vars that have not been set explicitly. If `LANG` is not working for you then you need to trace through your profile and find out what is overriding it. – Philip Couling Jun 01 '17 at 15:41
  • @couling - After NOT setting LC_ALL, I got these errors: https://pastebin.com/AgerQC7q -- On Ubuntu 16.04 LTS - and while using apt to dist-upgrade. – Apache Aug 18 '17 at 07:30
  • @Shiki `If LANG is not working for you then you need to trace through your profile and find out what is overriding it.` But looking at your error you may need too look at this https://stackoverflow.com/questions/2499794/how-to-fix-a-locale-setting-warning-from-perl – Philip Couling Aug 18 '17 at 09:35
  • Works like a charm on Raspbian too (`sudo raspi-config` just caused more problems than good) – Zoe Jan 20 '19 at 15:29
5

In order to get back to English, I had to change my locale in 3 places:

  1. /etc/default/locale

    by running this command:

    $ sudo update-locale LANG=en_US.UTF-8 LANGUAGE= LC_MESSAGES= LC_COLLATE= LC_CTYPE=
    
  2. ~/.config/plasma-localerc and ~/.config/plasma-locale-settings.sh

    By going to my KDE settings / Regional Settings / Language

And reboot.

kolypto
  • 611
  • 1
  • 5
  • 12
1

You can also do this interactively using dpkg-reconfigure:

$ sudo dpkg-reconfigure locale

and follow the steps on the next screens.

After that, logout/login again and/or reboot.

s.k
  • 1,170
  • 2
  • 14
  • 44