Can I remove installed translations for packages

I have >200MB of translations for packages (-lang). These were installed automatically with the packages on OpenSuse Leap 15.6 & KDE. I run all the packages in english, although I added a couple of spelling language packages for use with LibreOffice.

I can’t see why these “-lang” translations are required and I would like to delete all to save space/ clean. I deleted a few and haven’t experienced any difference or problem but I think if not necessary, why are they installed automatically or given as an option?. Even if I delete them, would they be inserted again during regular updates?

Any advice/ comments ?

Because not everybody speaks english. The lang packages are in most cases recommended packages. That is also the reason why they get installed with zypper standard settings. You can adapt your zypp.conf to not install recommended packages. But this “may” have side effects as not only language packs are recommends. So don’t wonder if there are some other features missing than and you need to install additional packages manually.

200MB are not that much except you have a very limited machine with only 64GB overall space or something. It would leave them where they are. They don’t hurt…

BUT, you can remove them if you want.

Thanks @hui for your response.
The recommended packages include quite a lot of packages that I need, so can’t turn off or will need to hunt for all those packages separately.
The -lang translations seem to be all in english by default, at least on my system. Is the “-lang translations” pointing to the user declared language, so that, say the same package loads the relevant user language?

@RG Hi, I remove and add locks, run zypper rm *-lang but check the list to see what else may be removed as will need to re-install if not a lang package. Then add a lock, zypper al *-lang

@malcomlewis brilliant, just the job.

Is there a way to dry-run the rm command to a text file so that I can check it doesn’t remove packages I need?

@RG zypper rm -D *-lang > rm_lang.txt should work.

1 Like

The rm dry-run option listed ~ 400 packages and ~1Gb to remove. This listed many packages that don’t require their -lang translation, but also many others, some major packages, that must be deleted if their -lang translation is deleted.

Thanks again for your help, saved me a lot of headaches!. I will admit defeat and leave the lot in, at least for now !

@RG Defeat is not an option :wink: Run rpm -qa *-lang --qf "%{name}\n" |xargs zypper rm -u instead add the -D and pipe to a file as needed…

You could start with showing at least some of those packages so that someone can check why they get installed.

I tested the three commands. Test2 successully isolated the *-lang packages but Test3 shows that the zypper rm would delete a very large number of files that require the translations and others that don’t, but can’t see the logic there

----------------------------------------------
Test1: zypper rm -D *-lang > ~/Tmp/rm_lang1.txt
-------------------------------------------
The following 425 packages are going to be REMOVED:
  accountsservice-lang apparmor-parser-lang apparmor-utils-lang appstream-glib-lang
  AppStream-lang ark ark-lang at-spi2-core-lang avahi-lang baloo5-file baloo5-file-lang
 baloo5-imports

  etc

  yakuake yakuake-lang zenity-lang zim-lang

The following pattern is going to be REMOVED:
  kde_plasma

425 packages to remove.
After the operation, 961.6 MiB will be freed.

---------------------------------------------------
Test2: rpm -qa *-lang --qf "%{name}\n" > ~/Tmp/rm_lang2.txt
----------------------------------------------------
libksane-lang
breeze5-style-lang
libqt5keychain1-lang
kuserfeedback-lang
k3b-lang
libKF5SyntaxHighlighting5-lang
ModemManager-lang
gstreamer-plugins-ugly-lang
gstreamer-plugins-good-lang
plasma5-integration-plugin-lang
keepassxc-lang
libKF5SonnetCore5-lang
kirigami2-lang
plasma5-disks-lang
kcalc-lang
phonon4qt5-lang

etc

yakuake-lang
sed-lang
zenity-lang
khotkeys5-lang
xfconf-lang
marble-lang
plasma-framework-lang

---------------------------------------------------------------------------------
Test3: sudo rpm -qa *-lang --qf "%{name}\n" | sudo xargs zypper rm -D -u >> ~/Tmp/rm_lang3.txt
---------------------------------------------------------------------------------------
The following 598 packages are going to be REMOVED:
  7zip accountsservice accountsservice-lang aha apparmor-parser-lang apparmor-utils-lang AppStream appstream-glib-lang AppStream-lang ark ark-lang at-spi2-core at-spi2-core-lang attica-qt5 avahi-lang baloo5-file baloo5-file-lang baloo5-imports baloo5-kioslaves baloo5-kioslaves-lang baloo5-tools baloo5-tools-lang baloo5-widgets baloo5-widgets-lang bleachbit-lang bluedevil5 bluedevil5-lang bluez-obexd bluez-qt-imports bluez-qt-udev breeze breeze5-decoration breeze5-style breeze5-style-lang

  etc

xfconf-lang xkeyboard-config-lang xmlcharent xscreensaver-lang xsettingsd xz-lang yakuake yakuake-lang zenity-lang zim-lang

The following pattern is going to be REMOVED:
  kde_plasma

598 packages to remove.
After the operation, 1.1 GiB will be freed.

Agreed … any of those would be catastrophic for my system:

# zypper rm --dry-run *-lang > rm-lang.txt
[ ... ]

The following 518 packages are going to be REMOVED:
ModemManager-lang
[ ...]
xz-lang

The following 2 patterns are going to be REMOVED:
  kde kde_plasma

518 packages to remove.
After the operation, 857.8 MiB will be freed.

My KDE Plasma system wouldn’t work if I were to truly run it.

@aggie @RG they are only meta packages (patterns), just re-install with --no-recommends

Edit, for example;

zypper rm -t pattern gnome_basic
Reading installed packages...
Resolving package dependencies...

The following package is going to be REMOVED:
  patterns-gnome-gnome_basic

The following pattern is going to be REMOVED:
  gnome_basic

1 package to remove.
After the operation, 57.0 B will be freed.

I obviously did not list all the 500+ packages that would be removed.

However, I did a quick run-thru of the list … here’s a couple that would be removed:

plasma-framework 
plasma-framework-components 

I’m fairly confident that removing those two are important for KDE Plasma to work.

@aggie yup, so you can edit the file you create to exclude anything you want, then use the file to remove the lang packages only… or is it trying to auto remove (which would IMHO be a packaging error). All lang type packages should be recommends these days…

1 Like

Taking a couple of packages at random.

bor@tw:~> zypper --no-refresh info --supplements libksane-lang
...
Supplements    : [59]
    libKSaneWidgets6 = 24.05.1
    libKF5Sane6 = 24.05.1
    (libksane and namespace:language(ar))
    (libksane and namespace:language(be))
...
    (libksane and namespace:language(zh_CN))
    (libksane and namespace:language(zh_TW))
bor@tw:~> zypper --no-refresh info --supplements ModemManager-lang
...
Supplements    : [22]
    (ModemManager and namespace:language(cs))
    (ModemManager and namespace:language(da))
...
    (ModemManager and namespace:language(uk))
    (ModemManager and namespace:language(zh_CN))
bor@tw:~> 

So, both language packages provide translations for all languages and so gets pulled in if any language is configured. Now, I do not have them:

bor@tw:~> rpm -q ModemManager ModemManager-lang
ModemManager-1.20.6-2.3.x86_64
package ModemManager-lang is not installed
bor@tw:~> 

because I do not have any locale configured in zypper:

bor@tw:~> zypper locales 
Code | Language | Requested
-----+----------+----------
bor@tw:~> 

Apparently you have which explains those packages. If you remove those locales, zypper should also remove matching language packages.

There are small number of language packages that are explicit dependencies and so will always be present unless locked out.

Please, show the output of zypper locales

@arvidjaar , I think you got it, the zypper locales must be dragging in the translations!. How can you remove them? . I couldn’t see it in zypper locales .

@heitormoreira , output fr zypper locales below. I wanted the spellchecking apps, but I don’t know how this dragged the es & fr locales.
I don’t know how to get rid of them. I checked Yast and it only shows en as primary and no secondary languages

Code  | Language                 | Requested
------+--------------------------+----------
en    | English                  | Fallback
en_GB | English (United Kingdom) | Requested
es    | Spanish                  | Fallback
es_ES | Spanish (Spain)          | Requested
fr    | French                   | Fallback
fr_FR | French (France)          | Requested

I was expecting to see this.
If you want British English, you’ll have to stick with the language packages.
However, if you don’t mind reading US English you can do the following:

zypper addlocale en_US
zypper removelocale en_GB es_ES fr_FR

This is a defect.

@heitormoreira , thank you. I removed es_ES and fr_FR and this removed some large libreoffice localisation files. The spell checking dictionaries which need weren’t affected, so all great. I will keep en_GB though
Regards,

1 Like