Note: this wiki is no longer maintained. If you have any questions related to this wiki, please post them on the CrunchBang forums.
The package localepurge
(version 0.5.9) is just a simple script to recover disk space wasted for unneeded
locale files and localized man pages (interpret - language files). After first use, it will automatically be invoked upon completion of any apt installation run.
Note: This tool is a hack which is *not* integrated with Debian based package management systems and therefore is not for the faint of heart. This program interferes with the Debian based package management and can provoke strange, but usually harmless, behavior of programs related with apt/dpkg like dpkg-repack, debsums, reportbug, etc. Responsibility for its usage and possible breakage of your system therefore lies in the sysadmin's (your) hands.
However, this very easy and simple script can and will save you a few hundred megabytes of hard drive space.
Each and every application or package that you install on your system usually contain many locales (language files) which are not the language you understand or use daily. these locales data are installed by default and can takes up hundreds of megabytes of hard drive space, depending on which application or package you install.
so why let these useless data files reside on our system? we do not need them so let's purge them:
From a terminal, type:
sudo apt-get install localepurge
During the install, you will receive a prompt for your language. The language selections are in two digit codes, (for example: “en” for English.) scroll down to your language and once it's highlighted, click the “space bar” to select it. You may see several entries for your language: choose all the ones you think you might need. For example, a British English speaker might have the following locales enabled:
en en_GB en_GB.UTF-8 en_US en_US.UTF-8
Not all programmes may come with an en_GB locale, so the en_US is a fallback. UTF-8 is the default system encoding. If in doubt, enable it! (See /etc/locale.nopurge for your saved preferences.)
Once a locale is purged, it's not so easy to bring it back (refer to last section), so take your time.
Once localepurge has finished installing, from the same terminal, type:
It will run and inform you how much space it just saved you. (My first run save 82053K).
That's it, one single line to install localepurge. After the first run, it will automatically remove unnecessary locale data files whenever you install new applications or packages without your intervention.
When - for whatever reason - you want to get back your purged languages, you need to remove localpurge and reinstall every package you want to have the locales for.
Localpurge removes the locales, but doesn't rebuild them when you want to have them afterwards.