With zypper
, I can get package A depends on package B. However, what I need to know is which packages depend on package B.
Is there a way of generating a reverse dependency list?
With zypper
, I can get package A depends on package B. However, what I need to know is which packages depend on package B.
Is there a way of generating a reverse dependency list?
Let's say you want to know who depends on libpng14
In tcsh:
zypper search -i | cut -d \| -f 2 | tr -s '\n' ' ' > z.txt
foreach i ( `cat z.txt` )
zypper info --requires $i |grep libpng14 &&echo $i
end
And you in a while, you will start getting results like:
libpng14.so.14()(64bit)
libpng14.so.14(PNG14_0)(64bit)
DirectFB
libpng14.so.14()(64bit)
libpng14.so.14(PNG14_0)(64bit)
MPlayer
You need to separate the packages from the grep messages, however.
You can search (abbreviated with "se") for packages that require a certain package with:
zypper se --requires packagename
Also, you can search only among installed packages with:
zypper se -i --requires packagename
For example, to look for packages requiring libpng:
# zypper se -i --requires libpng
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
--+-----------------------------+---------------------------------------------------------------------+--------
i | DirectFB | Graphics Library for Framebuffer Devices | package
i | MPlayer | Multimedia Player | package
i | cairo-devel | Development environment for cairo | package
etc.
zypper se --requires gdal
shows gdal-devel
, while zypper info --requires gdal-devel
does not list gdal
as requirement. What am I misunderstanding? –
Kafiristan Zypper 1.14.33+ has --requires-pkg
which might yield more results than --requires
. See here for details.
# zypper se --requires-pkg packagename
# zypper help search | grep -A1 requires-pkg
--requires-pkg Search for all packages that require any of the provides of the
package(s) matched by the input parameters.
--requires
didn't work for me. I found --requires-pkg
in the help and it worked. I don't know why. –
Boost Let's say you want to know who depends on libpng14
In tcsh:
zypper search -i | cut -d \| -f 2 | tr -s '\n' ' ' > z.txt
foreach i ( `cat z.txt` )
zypper info --requires $i |grep libpng14 &&echo $i
end
And you in a while, you will start getting results like:
libpng14.so.14()(64bit)
libpng14.so.14(PNG14_0)(64bit)
DirectFB
libpng14.so.14()(64bit)
libpng14.so.14(PNG14_0)(64bit)
MPlayer
You need to separate the packages from the grep messages, however.
grep
command to not echo results) –
Cheerleader If it's already installed, you can use rpm --whatrequires:
--whatrequires CAPABILITY
Query all packages that require CAPABILITY for proper functioning.
Note that this does not return what requires a given package.
If not, you[we]'re out of luck for now.
I hope it's useful:
betatester@myryzen:~/tmp> rpm -qi --requires \`rpm -qa | grep 'package-name'\`
© 2022 - 2024 — McMap. All rights reserved.
grep
command to not echo results) – Cheerleader