6

I use the --purge option to remove existing locales before generating new one, but seems cannot remove existing locales?

e.g.

# locale-gen --purge en_US
# locale -a
C
en_AG
en_AU.utf8
en_BW.utf8
en_US
en_US.utf8
POSIX
zh_TW
Ryan
  • 5,341
  • 21
  • 71
  • 87

4 Answers4

9
  1. Clean /usr/lib/locale/ (delete everything, do a backup if you are afraid).
  2. Delete unneeded locale from /etc/default/locale file (do not delete this file, edit and delete the locales)
  3. Delete unneeded locale from /var/lib/locales/supported.d/* files (do not delete this files, edit them and delete the locales)
  4. Regenerate locales (locale-gen --purge).

Also you can try localepurge as Juice sad earlier.

Sacx
  • 2,541
  • 15
  • 13
2
sudo edit /etc/default/locale

Edit the LANGUAGE variable to remove whatever language that needs removed. Then reboot.

sudo apt-get install localepurge

After that you can run localepurge to remove old locale files.

Juice
  • 135
  • 10
1

Sure? you have run it as root or using sudo:

sudo locale-gen --purge en_US

Because it doesn't raise any error if you run it as regular user

user.dz
  • 121
  • 8
-1

Just do the following command if it is Ubuntu 18.04:

sudo apt-get purge -y language-pack-en-base
mja
  • 99
  • 2