dependencies of a package
Hi, I'm looking for a tool that lists all dependencies of a package. Background: when installing package 'trytond' I get around 200 additional packages, and onl around 50 with --no-recommends. Some of the packages that are installed with all recommendations I would like to understand where they are coming from...like qt5 libraries and jupyter packages Thanks Axel
On 07.02.22 14:20, Axel Braun wrote:
Hi,
I'm looking for a tool that lists all dependencies of a package. Background: when installing package 'trytond' I get around 200 additional packages, and onl around 50 with --no-recommends. The 'details' view of the build service gives you this information:
https://build.opensuse.org/package/binary/openSUSE:Factory/trytond/standard/... For an installed package, "rpm -q --requires ..." (resp. "rpm -q --recommends ...") shows dependencies. Hth, Klaus -- SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
Hallo Klaus Am Montag, 7. Februar 2022, 14:55:15 CET schrieb Klaus Kämpf:
I'm looking for a tool that lists all dependencies of a package. Background: when installing package 'trytond' I get around 200 additional packages, and onl around 50 with --no-recommends.
The 'details' view of the build service gives you this information:
https://build.opensuse.org/package/binary/openSUSE:Factory/trytond/standard/ x86_64/trytond-5.0.43-1.1.noarch.rpm
For an installed package, "rpm -q --requires ..." (resp. "rpm -q --recommends ...") shows dependencies.
Thank you for your input! zypper se -i --recommends works similar, and this is OK for a single packages, but is a bit difficult for nested dependencies. Best, Axel
On Mon, 2022-02-07 at 15:33 +0100, Axel Braun wrote:
Hallo Klaus
Am Montag, 7. Februar 2022, 14:55:15 CET schrieb Klaus Kämpf:
I'm looking for a tool that lists all dependencies of a package. Background: when installing package 'trytond' I get around 200 additional packages, and onl around 50 with --no-recommends.
The 'details' view of the build service gives you this information:
https://build.opensuse.org/package/binary/openSUSE:Factory/trytond/standard/ x86_64/trytond-5.0.43-1.1.noarch.rpm For an installed package, "rpm -q --requires ..." (resp. "rpm -q --recommends ...") shows dependencies.
Thank you for your input! zypper se -i --recommends works similar, and this is OK for a single packages, but is a bit difficult for nested dependencies.
AFAIK neither rpm nor zypper show nested deps. They can't be derived easily. running "zypper in" in a minimal container is probably the safest bet. Martin
Hello, On 2022-02-08 16:48, Martin Wilck wrote:
On Mon, 2022-02-07 at 15:33 +0100, Axel Braun wrote:
... zypper se -i --recommends works similar, and this is OK for a single packages, but is a bit difficult for nested dependencies.
AFAIK neither rpm nor zypper show nested deps. They can't be derived easily. running "zypper in" in a minimal container is probably the safest bet.
To show all directly required dependencies for an already installed RPM package I use # rmp -e --test installed_package Then one has to do that recursively for what was listed to get the transitive closure. In my experience this is the only reliably working way because rpm query commands only show some RPM data. I don't know how to prove if an already installed RPM package is installed because it is required or because it is recommended. Perhaps when "rmp -e --test installed_package" does not list it as required by another package one can conclude it is installed because it is recommended. To show all required dependencies for a not yet installed package I use # zypper in --dry-run package_to_be_installed Kind Regards Johannes Meixner -- SUSE Software Solutions Germany GmbH Maxfeldstr. 5 - 90409 Nuernberg - Germany (HRB 36809, AG Nuernberg) GF: Ivo Totev
On 2/9/22 17:29, Johannes Meixner wrote:
Hello,
On 2022-02-08 16:48, Martin Wilck wrote:
On Mon, 2022-02-07 at 15:33 +0100, Axel Braun wrote:
... zypper se -i --recommends works similar, and this is OK for a single packages, but is a bit difficult for nested dependencies.
AFAIK neither rpm nor zypper show nested deps. They can't be derived easily. running "zypper in" in a minimal container is probably the safest bet.
To show all directly required dependencies for an already installed RPM package I use
# rmp -e --test installed_package
Then one has to do that recursively for what was listed to get the transitive closure. In my experience this is the only reliably working way because rpm query commands only show some RPM data.
I don't know how to prove if an already installed RPM package is installed because it is required or because it is recommended. Perhaps when "rmp -e --test installed_package" does not list it as required by another package one can conclude it is installed because it is recommended.
This ignores the 3rd case which is a user could have chosen to install it manually, but yeah the rpm database doesn't track the reason why a package was installed. This is why things like uninstalling a pattern don't really do anything meaningful, we simply don't have the info available. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
On Feb 09 2022, Johannes Meixner wrote:
To show all directly required dependencies for an already installed RPM package I use
# rmp -e --test installed_package
Then one has to do that recursively for what was listed to get the transitive closure.
Running zypper rm --dry-run should show you the whole list. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Hello, On 2022-02-09 11:49, Andreas Schwab wrote:
On Feb 09 2022, Johannes Meixner wrote:
To show all directly required dependencies for an already installed RPM package I use
# rmp -e --test installed_package
Then one has to do that recursively for what was listed to get the transitive closure.
Running zypper rm --dry-run should show you the whole list.
Yes! Example: # zypper rm --dry-run cups ... The following 7 packages are going to be REMOVED: OpenPrintingPPDs-ghostscript OpenPrintingPPDs-postscript cups cups-filters cups-pk-helper cups-pk-helper-lang hplip # rpm -e --test cups error: Failed dependencies: ... needed by ... cups-filters-... ... needed by ... cups-pk-helper-... ... needed by ... hplip-... # rpm -e --test cups-filters error: Failed dependencies: ... needed by ... OpenPrintingPPDs-postscript-... ... needed by ... OpenPrintingPPDs-ghostscript-... ... needed by ... hplip-... # rpm -e --test cups-pk-helper error: Failed dependencies: ... needed by ... cups-pk-helper-lang-... # rpm -e --test cups-pk-helper-lang [no output] # rpm -e --test OpenPrintingPPDs-postscript [no output] # rpm -e --test OpenPrintingPPDs-ghostscript [no output] # rpm -e --test hplip [no output] Kind Regards Johannes Meixner -- SUSE Software Solutions Germany GmbH Maxfeldstr. 5 - 90409 Nuernberg - Germany (HRB 36809, AG Nuernberg) GF: Ivo Totev
Hi again,
Gesendet: Mittwoch, 09. Februar 2022 um 12:08 Uhr Von: "Johannes Meixner" <jsmeix@suse.de> An: packaging@lists.opensuse.org Betreff: Re: dependencies of a package
On 2022-02-09 11:49, Andreas Schwab wrote:
On Feb 09 2022, Johannes Meixner wrote:
To show all directly required dependencies for an already installed RPM package I use
# rmp -e --test installed_package
Then one has to do that recursively for what was listed to get the transitive closure.
Running zypper rm --dry-run should show you the whole list.
Yes!
Talking about Leap 15.4 - no: localhost:/home/test # zypper rm --dry-run trytond Reading installed packages... Resolving package dependencies... The following package is going to be REMOVED: trytond 1 package to remove. (199 packages were installed including --recommends)
On Wed, 2022-02-09 at 13:10 +0100, Axel Braun wrote:
Talking about Leap 15.4 - no:
localhost:/home/test # zypper rm --dry-run trytond Reading installed packages... Resolving package dependencies...
The following package is going to be REMOVED: trytond
1 package to remove.
(199 packages were installed including --recommends)
zypper rm trytond shows all the things that MUST be removed when removing trytond - so what is actuall requiring it. YOUR usecase calls for "zypper rm -u trytond" - do a cleanup of 'now unused stuff' Cheers, Dominique
Hi Dominique
Gesendet: Mittwoch, 09. Februar 2022 um 13:21 Uhr Von: "Dominique Leuenberger / DimStar" <dimstar@opensuse.org> An: packaging@lists.opensuse.org Betreff: Re: Aw: Re: dependencies of a package
...
The following package is going to be REMOVED: trytond
1 package to remove.
(199 packages were installed including --recommends)
zypper rm trytond shows all the things that MUST be removed when removing trytond - so what is actuall requiring it.
YOUR usecase calls for "zypper rm -u trytond" - do a cleanup of 'now unused stuff'
You are right...that would remove the other 198 packages as well
Hello, On 2022-02-09 13:21, Dominique Leuenberger / DimStar wrote:
zypper rm trytond shows all the things that MUST be removed when removing trytond - so what is actuall requiring it.
YOUR usecase calls for "zypper rm -u trytond" - do a cleanup of 'now unused stuff'
on Leap 15.3 "man zypper" reads (excerpts): --------------------------------------------------------------- remove (rm) ... ... -u, --clean-deps Automatically remove dependencies which become unneeded after removal of requested packages. --------------------------------------------------------------- I wonder what exactly "unneeded after removal" means here. Unneeded by the system or unneeded by the user? All leave packages are "unneeded dependencies" but the leave packages are usually the applications which the user actually wants. I assume "zypper rm -u something" does not also "just remove" all leave packages. I assume when applicationA recommends applicationB and nothing else requires or recommends applicationB then "zypper rm -u applicationA" also removes applicationB but applicationB will not be removed when it is recommended by something else e.g. by an installed applicationC but then "zypper rm -u applicationA applicationC" will also remove applicationB. Kind Regards Johannes Meixner -- SUSE Software Solutions Germany GmbH Maxfeldstr. 5 - 90409 Nuernberg - Germany (HRB 36809, AG Nuernberg) GF: Ivo Totev
Am 09.02.22 um 13:51 schrieb Johannes Meixner:
Hello,
On 2022-02-09 13:21, Dominique Leuenberger / DimStar wrote:
zypper rm trytond shows all the things that MUST be removed when removing trytond - so what is actuall requiring it.
YOUR usecase calls for "zypper rm -u trytond" - do a cleanup of 'now unused stuff'
on Leap 15.3 "man zypper" reads (excerpts): --------------------------------------------------------------- remove (rm) ... ... -u, --clean-deps Automatically remove dependencies which become unneeded after removal of requested packages. ---------------------------------------------------------------
I wonder what exactly "unneeded after removal" means here. Unneeded by the system or unneeded by the user?
All leave packages are "unneeded dependencies" but the leave packages are usually the applications which the user actually wants. I assume "zypper rm -u something" does not also "just remove" all leave packages.
I assume when applicationA recommends applicationB and nothing else requires or recommends applicationB then "zypper rm -u applicationA" also removes applicationB but applicationB will not be removed when it is recommended by something else e.g. by an installed applicationC but then "zypper rm -u applicationA applicationC" will also remove applicationB.
This is explained in the man page: Automatically installed packages Packages added by the dependency solver in order to resolve a user’s request are remembered as having been automatically installed. They may later be removed, if no more user installed packages depend on them (e.g. by zypper remove --clean-deps). In the Status column the search command distinguishes between user installed packages (i+) and automatically installed packages (i). I can only assume that this covers not only required but also recommended packages if they have been automatically installed because of "solver.onlyRequires = false" in /etc/zypp/zypp.conf. My understanding is that this will drop recommended packages only if there are conflicts. So I think your assumption should be correct. Best regards, Aaron
Hi Axel, On 2022-02-07 14:20, Axel Braun wrote:
I'm looking for a tool that lists all dependencies of a package.
Not sure if this is what you are searching for, but I did something similar some time ago. It's a Python script that calls rpm recursively and lists all dependencies: https://gist.github.com/tomschr/23e3038d4678404072e75e4a12b81455 Probably it needs to be updated here and there. Hope it helps. -- Gruß/Regards, Tom Schraitle ---------------------------------------------------------------------- SUSE (o< Maxfeldstrasse 5 /\\ Documentation Specialist 90409 Nuernberg, Germany _\_v http://www.suse.com SUSE LINUX GmbH, Geschäftsführer: Ivo Totev HRB 36809 (AG Nürnberg)
Hello Tom,
Gesendet: Mittwoch, 09. Februar 2022 um 09:49 Uhr Von: "Tom Schraitle" <toms@suse.de> An: packaging@lists.opensuse.org Betreff: Re: dependencies of a package
I'm looking for a tool that lists all dependencies of a package.
Not sure if this is what you are searching for, but I did something similar some time ago. It's a Python script that calls rpm recursively and lists all dependencies:
https://gist.github.com/tomschr/23e3038d4678404072e75e4a12b81455
Probably it needs to be updated here and there. Hope it helps.
Thank you, that is already very helpful. Out of the box it worked and showed the 53 dependencies - but not the remaining 146 recommended packages. I will check if this can be adapted somehow.... Thanks Axel
participants (10)
-
Aaron Puchert
-
Andreas Schwab
-
Axel Braun
-
Axel Braun
-
Dominique Leuenberger / DimStar
-
Johannes Meixner
-
Klaus Kämpf
-
Martin Wilck
-
Simon Lees
-
Tom Schraitle