Search

localepurge: Automagically remove unnecessary locale data

February 15th, 2009 edited by Vicho

Article 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:

$ aptitude install mplayer
[...]
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.

Posted in Debian, Ubuntu |

8 Responses

  1. Spirit Says:

    I found that about a year ago when the huge locale directories annoyed me. It’s a wonderful thing. Highly recommended by me too.

  2. Dr No Says:

    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

    !

  3. Ant Says:

    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.

  4. log69 Says:

    # 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

  5. kolpur Says:

    #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!

  6. rm Says:

    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.

  7. erKURITA Says:

    # 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

  8. Vicho Says:

    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.