localepurge: Automagically remove unnecessary locale data
February 15th, 2009 edited by VichoArticle submitted by Geoffroy Youri Berret. We’ve run out of articles! If you like Debian Package of the Day please submit good articles about software you like!
localepurge allows you to remove unnecessary locale data you have on your system and prevents installing unneeded locales when installing new packages.
During the initial installation of localepurge you’ll be asked which languages you want in your system. The installation process will ask you if you want to purge also manpages for unwanted locales. Once installed, localepurge will be launched each time you install a new package on your system and will inform you of the amount of space you saved.
On a regular desktop installation you may save up to one hundred or more MiB. Even though space is no longer that expensive, this kind of tool might still be useful on netbooks, laptops and, in general, mobile technology with limited disk space.
nota bene: You have to be aware that localepurge is considered a hack of the package system, this is not a feature (localepurge(8)). localepurge is independent and not a part of dpkg/apt. Consider using it at your own risk. This warning sounds worrying but my personal experience of localepurge for the past 5 years tells me there is no reason to be afraid of —I never identified a problem on my system I could blame on localepurge. It’s nonetheless important to keep that in mind.
Let’s see of efficient it is with a mplayer installation on Debian Lenny for instance:
[...]
Preconfiguring packages …
Selecting previously deselected package libopenal1.
(Reading database … 95241 files and directories currently installed.)
Unpacking libopenal1 (from …/libopenal1_1%3a1.4.272-2_i386.deb) …
Selecting previously deselected package mplayer-skin-blue.
Unpacking mplayer-skin-blue (from …/mplayer-skin-blue_1.6-2_all.deb) …
Selecting previously deselected package mplayer.
Unpacking mplayer (from …/mplayer_1.0~rc2-17+lenny3_i386.deb) …
Processing triggers for man-db …
Processing triggers for menu …
Setting up libopenal1 (1:1.4.272-2) …
Setting up mplayer-skin-blue (1.6-2) …
Setting up mplayer (1.0~rc2-17+lenny3) …
Configuring mplayer …done
Processing triggers for menu …
localepurge: Disk space freed in /usr/share/man: 780K
[...]
$
localepurge is available in Debian since quite a long time, you’ll find it in old stable Sarge, Etch and Lenny. It’s also been available in Ubuntu (universe) for ages.
February 15th, 2009 at 9:52 am
I found that about a year ago when the huge locale directories annoyed me. It’s a wonderful thing. Highly recommended by me too.
February 15th, 2009 at 1:21 pm
Excellent!!!
# localepurge
localepurge: Disk space freed in /usr/share/locale: 172984K
localepurge: Disk space freed in /usr/share/man: 4872K
Total disk space freed by localepurge: 177856K
!
February 15th, 2009 at 4:07 pm
Nice:
# localepurge
localepurge: Disk space freed in /usr/share/locale: 405092K
localepurge: Disk space freed in /usr/share/man: 5504K
Total disk space freed by localepurge: 410596K
I hope I didn’t break anything! I kept all US ones.
February 15th, 2009 at 6:41 pm
# localepurge
localepurge: Disk space freed in /usr/share/locale: 268980K
localepurge: Disk space freed in /usr/share/man: 5684K
Total disk space freed by localepurge: 274664K
February 16th, 2009 at 1:44 am
#localepurge
localepurge: Disk space freed in /usr/share/locale: 10548K
Not much space was cleared in my system.
But, its really a good post. Thank You!
February 16th, 2009 at 5:28 am
localepurge: Disk space freed in /usr/share/locale: 239280K
localepurge: Disk space freed in /usr/share/man: 4492K
Total disk space freed by localepurge: 243772K
–
Very very nice :)
Of course that brings the question, how about not downloading/installing all that crap in the first place. I guess this is one of the few weaknesses in the current Debian packaging system.
February 16th, 2009 at 8:38 am
# localepurge
localepurge: Disk space freed in /usr/share/locale: 452920K
localepurge: Disk space freed in /usr/share/man: 5548K
Total disk space freed by localepurge: 458468K
Quite nice :D
February 17th, 2009 at 2:20 pm
rm:
You are right, it is a weakness in the current deb specification, so the DDs are working on the issue:
http://people.debian.org/~codehelp/tdeb/
Once TranslationDebs are implemented, apt will only download the translations you want and localepurge will be no longer needed. However, this won’t happen before squeeze+1, so we will have to use localepurge meanwhile.