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

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

in short - don’t - part of the system - even if you remove they will be restored when the package owning the files is update.

2 Likes

Alright I upped the allocation for 4 more gigabytes so it’s ok now.

@papajoke actually posted a fix for that, that in my opinion can be a solution of the problem (after one deletes everything not used)

Hello,

This forum thread is the internet’s top search link for

reduce /usr/share/locale

Here is my stab at an answer

This list deletes everything not english, proceed with caution, adjust to those language you won’t use only.

cd /usr/share/local ; rm -rf ab ace ach af ain ak am an ang ar as ast ay az az_IR ba bal bar be be@latin bg bi bn bn_BD bn_IN bo br bs byn ca ca@valencia ce ch chr ckb crh cs csb cs_CZ cv cy da de de_CH de_DE de@hebrew dv dz ee el en en@arabic en_AU en@cyrillic en@greek en@hebrew en_NZ en@piglatin en@shaw eo es es_ES es_EU es_MX et eu fa ff fi fil fo fr frp fur fy ga gd gez gl gn gu gv ha haw he hi hr ht hu hu_HU hy ia id id_ID ie io is it iu ja jam ka kab kg ki kk kl km kmr kn ko kok ku kv kw kw_GB ky lg li lo lt lv mai mg mhr mi mjw mk ml mn mo mr ms mt my na nah nb nb_NO nds ne nl nl_BE nl_NL nn no nso nv oc or pa pap pa_PK pi pl ps pt pt_BR pt_PT ro rom ro_MD ru ru_UA rw sc sd si sk sl so son sq sr sr@ije sr@latin sr@Latn sv sw ta te tg th ti tig tk tl tr tt tt@iqtelif tzm ug uk ur uz uz@cyrillic ve vi wa wal wo xh yi yo zh_CN zh_Hans zh_Hant zh_HK zh_TW zu

To run it at every boot, run the following command

echo "rm -rf rm -rf ab  ace  ach  af  ain  ak  am  an  ang  ar  as  ast  ay  az  az_IR  ba  bal  bar  be  be@latin  bg  bi  bn  bn_BD  bn_IN  bo  br  bs  byn  ca  ca@valencia  ce  ch  chr  ckb  crh  cs  csb  cs_CZ  cv  cy  da  de  de_CH  de_DE  de@hebrew  dv  dz  ee  el  en  en@arabic  en_AU     en@cyrillic   en@greek  en@hebrew  en_NZ  en@piglatin  en@shaw   eo  es  es_ES  es_EU  es_MX  et  eu  fa  ff  fi  fil  fo  fr  frp  fur  fy  ga  gd  gez  gl  gn  gu  gv  ha  haw  he  hi  hr  ht  hu  hu_HU  hy  ia  id  id_ID  ie  io  is  it  iu  ja  jam  ka  kab  kg  ki  kk  kl  km  kmr  kn  ko  kok  ku  kv  kw  kw_GB  ky  lg  li  lo  lt  lv  mai  mg  mhr  mi  mjw  mk  ml  mn  mo  mr  ms  mt  my  na  nah  nb  nb_NO  nds  ne  nl  nl_BE  nl_NL  nn  no  nso  nv  oc  or  pa  pap  pa_PK  pi  pl  ps  pt  pt_BR  pt_PT  ro  rom  ro_MD  ru  ru_UA  rw  sc  sd  si  sk  sl  so  son  sq  sr  sr@ije  sr@latin  sr@Latn  sv  sw  ta  te  tg  th  ti  tig  tk  tl  tr  tt  tt@iqtelif  tzm  ug  uk  ur  uz  uz@cyrillic  ve  vi  wa  wal  wo  xh  yi  yo  zh_CN  zh_Hans  zh_Hant  zh_HK  zh_TW  zu"  | sudo tee /usr/local/cleanlocale.sh > /dev/null
echo "[Unit]
Description=Clean locale
#After=network.target

[Service]
Type=oneshot
ExecStart=/usr/local/cleanlocale.sh
RemainAfterExit=true
StandardOutput=journal

[Install]
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/cleanlocale.service > /dev/null
sudo systemctl enable --now cleanlocale.service

based on Need to run command at startup - #2 by Mirdarthos

Bonus round, you can save another 150M by

cd /usr/share/dict
rm -rf  bokmaal brazilian  bulgarian catalan  danish dutch  french  italian  nederlands ngerman  norsk nynorsk polish portuguese  spanish svenska swedish

Stop necro-bumping half year old threads. With laughable “solution” at that.

1 Like

More or less simply uninstall glibc-locales

1 Like

@zbe
The idea of “necroposting” is a thing that exist and bad is extremely damaging to the forum ecosystem. You should forget this ever was a thing.

Like it or not, this is the internet’s premiere destination for this niche topic, not even in a manjaro only context.

If that bothers you, there’s an easy fix, set you forum display view to hide all posts older than an arbitrary date of your choice. And you just like we can stop destroying the internet’s discussion places by locking threads and complaining with useless comments about “necroposting”

And you can call it laughable solution all you want, this 24 comment long thread had NO solution otherwise other than “just live with it, it’ll reinstall anyway”

@philm
Except this retains the locales that are in current use.

Well, you really should

because it will

And besides, that isn’t the correct format for providing terminal output…or stuff.

When posting terminal output, copy the output and paste it here, wrapped in three (3) backticks, before AND after the pasted text. Like this:

```
pasted text
```

Or three (3) tilde signs, like this:

~~~
pasted text
~~~

This will just cause it to be rendered like this:

Sed
sollicitudin dolor
eget nisl elit id
condimentum
arcu erat varius
cursus sem quis eros.

Instead of like this:

Sed sollicitudin dolor eget nisl elit id condimentum arcu erat varius cursus sem quis eros.

Alternatively, paste the text you wish to format as terminal output, select all pasted text, and click the </> button on the taskbar. This will indent the whole pasted section with one TAB, causing it to render the same way as described above.

Thereby increasing legibility thus making it easier for those trying to provide assistance.

You neglected to mention the dropbear;

the distant cousin to the koala, that took an evolutionary turn for the worst; the meanest, and most vicious creature that never lived; that exists only to terrorise (mainly American) tourists by dropping from gum trees, and ripping their throats out…

The tourism commission like to disavow any knowledge of their existence for fear of the potential affect on Australian tourism in general, but those who have encountered them can vouch for the threat they pose. The unmarked graves of tourists; victims of the dropbear; keep growing in unspoken silence.

Even the locals are afraid to venture out at night…

I’m surprised you didn’t mention them…

:scream_cat: Disclaimer

1 Like

There is absolutely no valid reason to remove these files on a regular base

If you really - really want to - and think it is absolutely necessary.

:zap:
:zap: :warning: the folder holds translations for applications you have installed
:zap: :warning: if you are getting weird issues as a result - you are on your own
:zap: :warning: when the package providing the files is updated - they all come back
:zap:

2 Likes

Well so far, all vital systems show none of these effects after several reboots.

Mainsail webservice & klipperscreen & console application

With all the fluff I deleted and after updating, I now have 1.2GB left and that is 1.2GB more than I had earlier !

As long as you remember:

1 Like

Because the solution is, as already mentioned by @linux-aarhus, to NOT delete anything. And by the way, if you actually read the thread carefully you’d see that there was a “solution” with ‘NoExtract =’ mentioned.

What?

I have absolutely no idea what you’re talking about. So in my eyes this comment is useless. The previous one was not just useless but damaging.

And by the way, this is my /usr/share/locale size:

$ du -h --max-depth=0 /usr/share/locale
812M    /usr/share/locale

And know what? On a 250GB drive:

$ df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p3  220G   94G  116G  45% /

To have all my software, all my websites, and everything else as far as I know working perfectly? I’d say it’s a non-issue.

Yours isn’t a “solution”. It’s merely a workaround. a Workaround for an issue that doesn’t really exist…

Storage is inexpensive. Why bother with this?

1 Like

Is it?

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.