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
2
  • What distribution do you use?
    – Sacx
    Jun 18, 2014 at 11:17
  • 2
    @Sacx Since he tagged it Ubuntu, I would assume that is th edistro he's using.
    – Juice
    Jun 18, 2014 at 15:53

4 Answers 4

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.

1
  • It also works if instead of #4 you execute dpkg-reconfigure locales.
    – lepe
    Aug 30, 2017 at 9:25
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.

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

-1

Just do the following command if it is Ubuntu 18.04:

sudo apt-get purge -y language-pack-en-base

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .