Zypper pa --unneeded... what does it mean exactly?

HI all,
I recently saw this command in a few forum posts.
As it was the first time for me, I looked up the man pages for zypper, and then I tried it on my system.
It found 507 unneeded packages.
But what exactly is the definition of “unneeded” in tis context?
Can someone elaborate on the algorithm that zypper uses to decrete a package as “unneeded”?

Thank you in advance.
Cris

As I understand it, the unneeded packages are ones that were automatically installed previously but are no longer referenced as dependencies by existing packages.

No, packages that are installed and have no active repo behind them are called “orphaned”.

From man zypper

–orphaned
Show packages which are orphaned (without repository).

Orphaned ones are without repo, OTOH unneeded ones are still available in repos but are not referenced as dependencies by existing installed packages and were themselves not manually installed (i+).

That is what I said.

That is not what you said above.

@Cris70 ,
When you have that list, please study it carefully. I found out that one may differ very much of opinion between what the system classifies as “unneeded” and what you yourself think about that.

Sorry, what? :thinking:

I apologize, my fault.

Yes, your definition is what I have read more often. But I can not find it in man zypper . It is used there as if it is clear what this word means in this context. I am also not sure where you found that definition.

In any case, on my Leap 15.5

boven:~ # zypper pa --unneeded
Retrieving repository 'Updates from openSUSE Backports' metadata .......................................[done]
Building repository 'Updates from openSUSE Backports' cache ............................................[done]
Retrieving repository 'Packman' metadata ...............................................................[done]
Building repository 'Packman' cache ....................................................................[done]
Retrieving repository 'Updates from SLE 15' metadata ...................................................[done]
Building repository 'Updates from SLE 15' cache ........................................................[done]
Loading repository data...
Reading installed packages...
S | Repository                      | Name                                   | Version                                     | Arch
--+---------------------------------+----------------------------------------+---------------------------------------------+-------
i | Main (OSS)                      | accounts-qml-module                    | 0.7-bp155.3.13                              | x86_64
i | Main (Non-OSS)                  | AdobeICCProfiles                       | 2.0-lp155.2.4                               | noarch
i | Main (OSS)                      | akregator                              | 22.12.3-bp155.1.7                           | x86_64
i | Main (OSS)                      | apache2-mod_perl                       | 2.0.12-bp155.1.12                           | x86_64
i | Main (OSS)                      | ark                                    | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | at                                     | 3.2.2-150400.4.3.10                         | x86_64
i | Updates from SLE 15             | avahi-autoipd                          | 0.8-150400.7.16.1                           | x86_64
i | Main (OSS)                      | baloo5-file                            | 5.102.0-bp155.1.7                           | x86_64
i | Main (OSS)                      | baloo5-tools                           | 5.102.0-bp155.1.7                           | x86_64
i | Main (OSS)                      | bash-completion-devel                  | 2.7-150400.13.3.1                           | noarch
i | Main (OSS)                      | bash-completion-doc                    | 2.7-150400.13.3.1                           | noarch
i | Main (OSS)                      | bc                                     | 1.07.1-11.37                                | x86_64
i | Main (OSS)                      | bea-stax-api                           | 1.2.0-9.63                                  | noarch
i | Updates from SLE 15             | btrfsprogs                             | 5.14-150500.10.3.1                          | x86_64
i | Main (OSS)                      | chrony                                 | 4.1-150400.19.4                             | x86_64
i | Main (OSS)                      | clamz                                  | 0.5-bp155.2.11                              | x86_64
i | Main (OSS)                      | cln                                    | 1.3.6-bp155.3.15                            | x86_64
i | Updates from SLE 15             | db48-utils                             | 4.8.30-150000.7.9.1                         | x86_64
i | Updates from SLE 15             | dhcp-client                            | 4.3.6.P1-150000.6.19.1                      | x86_64
i | Main (OSS)                      | dmz-icon-theme-cursors                 | 11.3.0-1.22                                 | noarch
i | Main (OSS)                      | dolphin                                | 22.12.3-bp155.2.7                           | x86_64
i | Updates from SLE 15             | dracut-mkinitrd-deprecated             | 055+suse.382.g80b55af2-150500.3.18.1        | x86_64
i | Main (OSS)                      | dragonplayer                           | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | enchant-1-backends                     | 1.6.1-1.57                                  | x86_64
i | Main (OSS)                      | enscript                               | 1.6.6-1.17                                  | x86_64
i | Main (OSS)                      | exiv2                                  | 0.27.5-150400.15.4.1                        | x86_64
i | Main (OSS)                      | expect                                 | 5.45.4-3.3.1                                | x86_64
i | Main (OSS)                      | ffmpegthumbs                           | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | finger                                 | 1.3-1.27                                    | x86_64
i | Main (OSS)                      | fipscheck                              | 1.4.1-3.3.1                                 | x86_64
i | Main (OSS)                      | firebird                               | 3.0.4.33054-1.7                             | x86_64
i | Updates from SLE 15             | ft2demos                               | 2.10.4-150000.4.15.1                        | x86_64
i | Main (OSS)                      | gd                                     | 2.2.5-11.3.1                                | x86_64
i | Main (OSS)                      | gfxboot                                | 4.5.85-150400.3.3.1                         | x86_64
i | Main (OSS)                      | gimp-help-nl                           | 2.10.0-150400.16.5                          | noarch
i | Updates from SLE 15             | glibc-locale-base-32bit                | 2.31-150300.68.1                            | x86_64
i | Main (OSS)                      | gnome-icon-theme                       | 3.12.0-150400.12.5                          | noarch
i | Main (OSS)                      | gnu-unifont-bitmap-fonts               | 10.0.07-1.14                                | noarch
i | Main (OSS)                      | google-noto-fonts-doc                  | 20170919-9.9                                | noarch
i | Updates from SLE 15             | grub2-i386-pc-extras                   | 2.06-150500.29.22.2                         | noarch
i | Updates from SLE 15             | grub2-x86_64-efi-extras                | 2.06-150500.29.22.2                         | noarch
i | Updates from SLE 15             | gsl                                    | 2.6-150200.3.4.3                            | x86_64
i | Main (OSS)                      | gutenprint                             | 5.2.14-150000.3.2.2                         | x86_64
i | Main (OSS)                      | gwenview5                              | 22.12.3-bp155.1.9                           | x86_64
i | Main (OSS)                      | htdig                                  | 3.2.0b6-bp155.3.15                          | x86_64
i | Updates from SLE 15             | ibus-dict-emoji                        | 1.5.25-150400.3.3.1                         | noarch
i | Main (OSS)                      | icedtea-web                            | 1.7.2-150100.7.3.1                          | x86_64
i | Main (OSS)                      | icoutils                               | 0.32.3-bp155.3.11                           | x86_64
i | Main (OSS)                      | info2html                              | 2.0-bp155.3.10                              | noarch
i | Main (OSS)                      | intel-gpu-tools                        | 1.24-150400.1.4                             | x86_64
i | Main (OSS)                      | intlfonts                              | 1.2.1-1.21                                  | noarch
i | Updates from SLE 15             | ipmitool                               | 1.8.18.238.gb7adc1d-150400.3.6.1            | x86_64
i | Main (OSS)                      | iproute2-arpd                          | 5.14-150400.1.8                             | x86_64
i | Updates from SLE 15             | iscsiuio                               | 0.7.8.8-150500.46.3.1                       | x86_64
i | Main (OSS)                      | ispell                                 | 3.4.05-bp155.1.6                            | x86_64
i | Main (OSS)                      | jansi-native                           | 1.7-150200.3.4.4                            | x86_64
i | Updates from SLE 15             | jline                                  | 2.14.6-150200.3.6.1                         | noarch
i | Main (OSS)                      | jline1                                 | 1.0-150200.3.4.4                            | x86_64
i | Updates from openSUSE Backports | kactivitymanagerd-lang                 | 5.27.9-bp155.2.3.1                          | x86_64
i | Main (OSS)                      | kaddressbook                           | 22.12.3-bp155.1.6                           | x86_64
i | Main (OSS)                      | kcalc                                  | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kcharselect                            | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kcolorchooser                          | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kde-oxygen-fonts                       | 0.4.0-bp155.2.12                            | noarch
i | Main (OSS)                      | kde-print-manager                      | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kde4-filesystem                        | 4.14-bp155.2.10                             | x86_64
i | Main (OSS)                      | kdeconnect-kde                         | 22.12.3-bp155.1.6                           | x86_64
i | Main (OSS)                      | kdegraphics-thumbnailers               | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kdenetwork-filesharing                 | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kdnssd                                 | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | keditbookmarks                         | 22.12.3-bp155.1.5                           | x86_64
i | Updates from openSUSE Backports | kgamma5                                | 5.27.9-bp155.2.3.1                          | x86_64
i | Main (OSS)                      | kget                                   | 22.12.3-bp155.1.7                           | x86_64
i | Main (OSS)                      | kio_audiocd                            | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kio_kamera                             | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kmag                                   | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kmahjongg                              | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kmines                                 | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kmousetool                             | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | knotes                                 | 22.12.3-bp155.1.6                           | x86_64
i | Main (OSS)                      | kompare                                | 22.12.3-bp155.1.7                           | x86_64
i | Main (OSS)                      | konqueror                              | 22.12.3-bp155.1.6                           | x86_64
i | Main (OSS)                      | konsole                                | 22.12.3-bp155.1.6                           | x86_64
i | Main (OSS)                      | kontact                                | 22.12.3-bp155.1.6                           | x86_64
i | Main (OSS)                      | konversation                           | 22.12.3-bp155.1.9                           | x86_64
i | Main (OSS)                      | korganizer                             | 22.12.3-bp155.1.6                           | x86_64
i | Main (OSS)                      | kpat                                   | 22.12.3-bp155.1.5                           | x86_64
i | Updates from SLE 15             | krb5-server                            | 1.20.1-150500.3.6.1                         | x86_64
i | Main (OSS)                      | kreversi                               | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kruler                                 | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | ksh                                    | 93vu-bp155.2.58                             | x86_64
i | Main (OSS)                      | ksudoku                                | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | ksysguard5                             | 5.22.0-bp155.3.6                            | x86_64
i | Main (OSS)                      | kwallet-tools-lang                     | 5.103.0-150500.1.1                          | x86_64
i | Main (OSS)                      | kwalletmanager5                        | 22.12.3-bp155.1.5                           | x86_64
i | Main (OSS)                      | kwebkitpart                            | 1.3.4git.20171117T115813~cca571d-bp155.2.15 | x86_64
i | Main (OSS)                      | kwrite                                 | 22.12.3-bp155.1.7                           | x86_64

First few only, there are more then 300 in that list.

But as an illustration of my warning to the OP above: kwrite is in the list. Maybe unneeded by zypper’s ideas but what thinks the user? The best is to look at your own system if what zypper advises as “unneeded” fits into your usage pattern.

Thank you both @pavinjoseph and @hcvv.
I’ll take the advice of hcvv and carefully verify the listing, as I’m worried too that some of the packages deemed unneded may actually be needed (or at least wanted) :wink:

Cris

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