General cleanup of Sailfish installation - the removal of unused libraries

Can anyone advise what is the preferred solution to remove unused libraries in Sailfish (in the sense of general cleanup)?

Something like:

  • “apt autoremove” or “apt purge $(deborphan)” in Debian|Ubuntu
  • or “flatpak uninstall --unused” for Flatpaks.

I had a look at SFOS cheat-sheet Sailfish OS Cheat Sheet | Sailfish OS Documentation, but had no advice there.

However pkcon -h shows that there is --autoremove as “Automatically remove unused dependencies”, but as I understand, it is meant to be used during the removal of main package “pkcon remove $packagename --autoremove”.

2 Likes

you can use zypper for this

zypper se --unneeded and zypper rm --clean-deps

4 Likes

Thanks! Funny is I was looking for this but couldn’t find. Maybe I didn’t fetch the complete help? :thinking:

Thanks. In my case I get this response: “The flag --unneeded is not known.” (zypper 1.14.38). And zypper rm --clean-deps needs package name as argument.

3 Likes

It appears to be

zypper packages --orphaned

and

zypper packages --unneeded

WARNING: DO engage brain before just uninstalling anything from that output. You will be unhappy if you e.g. think that this is actually unneeded:

i | adaptation0       | libhybris-libGLESv1
i | jolla             | mesa-llvmpipe-libgbm 
5 Likes

Thanks to everyone for responses. For my usecase I found that this was a suitable solution:

rpm -qa --queryformat '%{SIZE} %{NAME} \n' | sort -n -r | head -50