2012-02-27

Debian Wheezy : Removing unused locales and translations

Removing Locales

Debian includes several locales and translations in its default installation. Typically, we need very few of them, mostly just one! Here is how I removed unused locales and translations from my Debian Wheezy installation. This should apply to Sid too, but I have not verified it. The following steps should be executed as root.

  • Issue the command locale -a -v to see a full list of the locales currently installed. Should this list already match your requirement, you can skip the remainder of this section.
  • Edit (or create) the file /etc/default/locale. Include the entries for your desired locale. My file looks as follows.
  • #  File generated by update-locale
    LANG=en_IN
    LANGUAGE="en_IN:en"
    
  • Remove all the files in the directory /usr/lib/locale.
  • Now, regenerate the locales based on your default configuration.

Here is the sequence of steps.

> locale -a -v


> vi /etc/default/locale


> cd /usr/lib/locale
> rm -fr *

> locale-gen

Removing Translations

Unneeded translations consume disk space, network bandwidth (when updating or upgrading), and can potentially make glibc larger. To remove unused translations, execute the following steps as root.

> cd /etc/apt/apt.conf.d
> touch 99translations


> cat 99translations
Acquire::Languages "none";


> cd /var/lib/apt/lists
> rm -f *Translation*

If you want to be sure, you can reboot the system. Now, when you apt-get update or apt-get upgrade, you should no longer have unused translations checked for, updated or downloaded.

Post a Comment