How to get rid of locale files in /usr/share?

I’m only using English which was specified at the manjaro install, but still I got over 500 megabytes of /usr/share/locale files

How do I delete this nicely? My partition is rather small so I don’t have 500mb to waste on locale files.

Thanks.

Do you already use btrfs compression ?

  • If you are short on free space, any update may break your manjaro.
  • If you do not update you will break your manjaro.

:footprints:

2 Likes

Hi @maboleth,

I honestly don’t think you can. Or rather, it would be back on your next upgrade. FWIW, mine is quite bit bigger, even than that:

$ dua /usr/share/locale                                                                                                                                                                                                                               1 ↵
779.34 MiB /usr/share/locale
2 Likes

I’m not sure why is manjaro wasting 500-800mb of space on locale files that user did not specify? I strictly opted for English only at the setup. Also no other language is selected in Manjaro Settings.

Even if we could change our minds in the future, downloading the required files is always there, versus install every possible known language. :slight_smile:

1 Like

No I have no compression.

My past Arch install with xfce used around 5-6gb, but Manjaro xfce is 10gb already so I wanted to see why. My total partition allocation is 12gb.

This is something i wondered even back in the days that i used ubuntu. A large part of install and system update time went into generating locales for languages i never even thought of using. Luckily such time is not wasted on manjaro, but still it’s unnecessary bloat to have locales that you don’t want.

1 Like

This is not just for selecting a language, but also for supporting other locale-specific data, such as timezones, numerical notations, currency symbols (and symbol placement), keyboard layouts, paper sizes, telephone numbers, people’s names, character encodings, et al. In an internationalized world, you need all of these.

Besides, it’s not Manjaro that’s doing this. First of all, we source most of our packages directly from Arch without any modifications, and secondly, every GNU/Linux distribution has this.


I think I can beat you… :point_down:

[nx-74205:/dev/pts/2][/home/aragorn]
[aragorn] >  du -sh /usr/share/locale
1009M   /usr/share/locale

Kid making a funny face

:stuck_out_tongue:

4 Likes

Ok, compared to you guys, my install is language-deprived. A starving ascetic 500mb. :smile:

2 Likes

a Decisive victory!

And I didn’t even know we were having a competition.

1 Like

I use US English as the system language, but I’ve also got several other locales defined for supporting the time in a 24-hour format on the login screen, as well as metric units, metric paper size, and so on. :wink:

[nx-74205:/dev/pts/2][/home/aragorn]
[aragorn] >  locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE=nl_BE.UTF-8
LC_MONETARY=nl_BE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=nl_BE.UTF-8
LC_NAME=nl_BE.UTF-8
LC_ADDRESS=nl_BE.UTF-8
LC_TELEPHONE=nl_BE.UTF-8
LC_MEASUREMENT=nl_BE.UTF-8
LC_IDENTIFICATION=nl_BE.UTF-8
LC_ALL=

Even though it’s not in that list, I’ve also created the locales for Australian English due to Australia being the only Anglo-Saxon country that has gone fully metric in every respect. :wink:

And what about South Africa? Or is it the fact the we measure computer screens in inches? There might be something else, but if so, then it’s not something I’ve come across.

South Africa is not fully metric yet. It comes close, but it’s not as pure as Australia, which is absolutely metric in everything. No miles, no inches, and not even horsepower — brake or DIN — or foot-pounds (pound-feet).

It’s all in kiloWatts, Newtonmeters, meters, kilometers, centimeters, liters (AU/UK spelling: litres), and so on. :wink:

(Of course, you then also do get the kangaroos, the dingos, the crocodiles, the Tasmanian devils, the platypuses, and all that other jazz. :rofl:)

Oh yeah, I’m using american english, but as European, I always change imperial cr%p to metric, Celsius and dd/mm date. :sweat_smile:

1 Like

That’s why they need their own locale.

And that’s really interesting. It kind of makes me semi-jealous. But only a bit.

Edit:

Now I’m wondering…is they don’t have pound-feet, as you said, what does children do that wants to tantrum?

:thinking:

1 Like

Even if it is not manjaros fault, it is still extremely stupid to waste space in that way. Mine is also more than a gig. And since it is obviously variable between users, so with the ammount of installed programs, the only possible explanation is these are translations of programs for languages i do not need. Which should be considered a bug, regardless if in arch or somewhere else.
I guess the idea behind it was not to download anything for the console tools if locale changes, and probably this idea was concieved in the 90s when the internet was dial up and not for everyone. But nowadays there are other ways to do it in separate language packages, as we see in the localisation of modern Software like libreoffice or firefox.

p.s. yes, my theory is proven

Unfortunately it also means we cannot delete them with a script looking for, for example, all the Finnish translations, because they will reappear on next update as those are part of the package. But just imagine how much bandwidth and space could be saved on the mirrors…those are like 5% of the size of my installation. Wasted.

1 Like

There used to be a brand of pen (antiquated writing instrument) called ‘Kilometrico’, which, in accordance with the lore of the land, was rumoured to… write in metric. :eyes:

2 Likes

They’re still manufactured and can be found in shops & supermarkets - I bought a packet of them last year. I remember when they first went on sale in the 1970s - the selling point was (and still is) that each pen had enough ink to do at least 1 kilometre of writing.

1 Like

we have the key no extract (file in packages) in pacman.conf


EDIT

example (extract only one country)

NoExtract = usr/share/locale/* !usr/share/locale/fr* 
NoExtract = usr/share/help/* !usr/share/help/fr*

for me:

pacman -Ql vlc | grep uk
vlc /usr/share/locale/uk/LC_MESSAGES/vlc.mo
file /usr/share/locale/uk/LC_MESSAGES/vlc.mo
/usr/share/locale/uk/LC_MESSAGES/vlc.mo: cannot open `/usr/share/locale/uk/LC_MESSAGES/vlc.mo' (No such file or directory)

With debug option, we can view if “blog” is ok

LANG=C sudo pacman -S vlc --debug
...
debug: config: NoExtract: usr/share/locale/*
debug: config: NoExtract: !usr/share/locale/fr*
...

:: Proceed with installation? [Y/n] 

...
debug: usr/share/locale/mr/LC_MESSAGES/ is in NoExtract, skipping extraction of /usr/share/locale/mr/LC_MESSAGES/
debug: usr/share/locale/mr/LC_MESSAGES/vlc.mo is in NoExtract, skipping extraction of /usr/share/locale/mr/LC_MESSAGES/vlc.mo
debug: usr/share/locale/ms/ is in NoExtract, skipping extraction of /usr/share/locale/ms/
debug: usr/share/locale/ms/LC_MESSAGES/ is in NoExtract, skipping extraction of /usr/share/locale/ms/LC_MESSAGES/
debug: usr/share/locale/ms/LC_MESSAGES/vlc.mo is in NoExtract, skipping extraction of /usr/share/locale/ms/LC_MESSAGES/vlc.mo
debug: usr/share/locale/my/ is in NoExtract, skipping extraction of /usr/share/locale/my/
debug: usr/share/locale/my/LC_MESSAGES/ is in NoExtract, skipping extraction of /usr/share/locale/my/LC_MESSAGES/
debug: usr/share/locale/my/LC_MESSAGES/vlc.mo is in NoExtract, skipping extraction of /usr/share/locale/my/LC_MESSAGES/vlc.mo
debug: usr/share/locale/nb/ is in NoExtract, skipping extraction of /usr/share/locale/nb/
debug: usr/share/locale/nb/LC_MESSAGES/ is in NoExtract, skipping extraction of /usr/share/locale/nb/LC_MESSAGES/
debug: usr/share/locale/nb/LC_MESSAGES/vlc.mo is in NoExtract, skipping extraction of /usr/share/locale/nb/LC_MESSAGES/vlc.mo
debug: usr/share/locale/ne/ is in NoExtract, skipping extraction of /usr/share/locale/ne/
debug: usr/share/locale/ne/LC_MESSAGES/ is in NoExtract, skipping extraction of /usr/share/locale/ne/LC_MESSAGES/
debug: usr/share/locale/ne/LC_MESSAGES/vlc.mo is in NoExtract, skipping extraction of /usr/share/locale/ne/LC_MESSAGES/vlc.mo
debug: usr/share/locale/nl/ is in NoExtract, skipping extraction of /usr/share/locale/nl/
debug: usr/share/locale/nl/LC_MESSAGES/ is in NoExtract, skipping extraction of /usr/share/locale/nl/LC_MESSAGES/
debug: usr/share/locale/nl/LC_MESSAGES/vlc.mo is in NoExtract, skipping extraction of /usr/share/locale/nl/LC_MESSAGES/vlc.mo
debug: usr/share/locale/nn/ is in NoExtract, skipping extraction of /usr/share/locale/nn/
debug: usr/share/locale/nn/LC_MESSAGES/ is in NoExtract, skipping extraction of /usr/share/locale/nn/LC_MESSAGES/
debug: usr/share/locale/nn/LC_MESSAGES/vlc.mo is in NoExtract, skipping extraction of /usr/share/locale/nn/LC_MESSAGES/vlc.mo

pacman test !

pacman -Qk vlc 
vlc: 1084 total files, 0 missing files

? 0 missing files :thinking:
but if I remove NoExtract key in pacman.conf :

pacman -Qk vlc
warning: vlc: /usr/share/locale/ach/LC_MESSAGES/vlc.mo (No such file or directory)
warning: vlc: /usr/share/locale/af/LC_MESSAGES/vlc.mo (No such file or directory)
...
warning: vlc: /usr/share/locale/wa/LC_MESSAGES/vlc.mo (No such file or directory)
warning: vlc: /usr/share/locale/zh_CN/LC_MESSAGES/vlc.mo (No such file or directory)
warning: vlc: /usr/share/locale/zh_TW/LC_MESSAGES/vlc.mo (No such file or directory)
warning: vlc: /usr/share/locale/zu/LC_MESSAGES/vlc.mo (No such file or directory)
vlc: 1084 total files, 117 missing files

117 missing files :ok_hand: and /usr/share/locale/fr/LC_MESSAGES/vlc.mo exists

3 Likes

But they still drive on the wrong side of the road :slight_smile:

1 Like

Every OS that I’m aware of has this bug then. In Windows you don’t see all these translation files because they’re embedded in the apps themselves (or at least that was the case back when I did Windows development).

If it really bothers you - AUR (en) - localepurge

WARNING - I have not used or tested localepurge myself and am not going to.

In the grand scheme of things 1GB disk space to support nearly every language in the world is not a big deal given the price of storage today, and is a far simpler solution than having ~200 localized versions of every single package. Your pacman cache will grow by more than that on every major update, and will keep growing unless maintained. So if you feel that /usr/share/locale needs to be maintained too then do it at the same time. Could be as simple as adding a pacman hook.

1 Like