[SOLVED] Reverse/backward dependency checking in Slackware
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think I might have asked this question here many years ago - but looking through all my previous posts, I just can't find it. I'm perfectly happy to sort out dependencies when I install a new package in Slackware - the current system works fine: either read the info at SBo, or try to run the software on the command line and it will complain with some relevant error message.
However, I am faced with kind of the opposite problem. I need to start with a package, and find out what depends on it. For example, I have 'twolame' installed - and I was trying to figure out which software installed on the laptop needs it - if any - so that I know if it is safe to remove it. I can't figure out a way to do this. I think someone suggested grep'ing some directory. Going through /var/log/packages/ doesn't seem to help - as the README or package.info files with dependencies info are not stored there. Is there another way to obtain this information? I looked through the Slackware docs and wiki - but all the info seems to be about forward dependency checking - not backwards.
As a small side note, I suppose it would be helpful if SBo would have the option to search through package descriptions on the website - if that is possible at all. This way it would be possible to search for packages which depend on the particular package you are looking at - and then check if any of them are installed on the local machine.
Last edited by xj25vm; 04-01-2021 at 09:27 AM.
Reason: spelling
Be aware that SBo's reverse dependency search only lists hard dependencies, not optional dependencies. If you are compiling SBo packages with optional dependencies, then you should be maintaining your own queue files as self-documentation (and for easier compiling!). For example, if I search for speex on my local queue list it matches several more packages than just vlc (the only package I have installed which appears on https://slackbuilds.org/advsearch.ph...&stype=revdep1)
As optional dependencies should be documented in the README, you should be able to grep for the program. Continuing with my speex example:
Code:
# grep speex /var/lib/sbopkg/SBo/14.2/*/*/README
/var/lib/sbopkg/SBo/14.2/audio/TiMidity++/README:Optional dependencies are jack, speex, and portaudio.
/var/lib/sbopkg/SBo/14.2/audio/icecast/README:Optional dependencies: speex
/var/lib/sbopkg/SBo/14.2/development/squeak-vm/README:Optional dependency: speex
/var/lib/sbopkg/SBo/14.2/games/FlightGear/README:speex and flite are optional dependencies for voice communication
/var/lib/sbopkg/SBo/14.2/libraries/audiere/README:Optional dependencies are speex, libcdaudio and dumb (this one
/var/lib/sbopkg/SBo/14.2/libraries/libfishsound/README:Optional dependency: speex. Autodetected at build time.
/var/lib/sbopkg/SBo/14.2/libraries/libshout/README:speex is an optional dependency.
/var/lib/sbopkg/SBo/14.2/multimedia/ffmpeg/README:SPEEX=yes|no (default: no), requires speex
/var/lib/sbopkg/SBo/14.2/multimedia/ffmpeg4/README: LIBSPEEX=yes # requires speex
/var/lib/sbopkg/SBo/14.2/multimedia/gnash/README:Optional but recommended dependencies are speex, gst0-ffmpeg,
/var/lib/sbopkg/SBo/14.2/network/yate/README:Optional dependencies: postgresql, speex, amrnb
Does hoorex return packages from the entire SBo list, or only SBo packages already installed locally?
Quote:
Originally Posted by drumz
Be aware that SBo's reverse dependency search only lists hard dependencies, not optional dependencies. If you are compiling SBo packages with optional dependencies, then you should be maintaining your own queue files as self-documentation
Hmm - as far as I can tell sbotools (which is what I'm using now) don't have the option to save queue files - I think I'll have to take a look at sbopkg instead.
Quote:
Originally Posted by drumz
As optional dependencies should be documented in the README, you should be able to grep for the program. Continuing with my speex example:
This is sort of what I ended up doing. It does return results from the entire SBo tree, not only installed packages - but it is just about enough to work out the answer to the question.
Quote:
Originally Posted by volkerdi
Here's a little something I use around here.
Thank you - I will give the script a try
Last edited by xj25vm; 04-04-2021 at 03:59 PM.
Reason: spelling
Does hoorex return packages from the entire SBo list, or only SBo packages already installed locally?
That is optional. By default packages from the entire SBo repo are considered, but can be restricted to those packages already installed. From the man page:
Code:
-i, --installed
Restrict output to those packages already installed, with the exception of the target package(s) which are included.
I need to start with a package, and find out what depends on it. For example, I have 'twolame' installed - and I was trying to figure out which software installed on the laptop needs it - if any - so that I know if it is safe to remove it. I can't figure out a way to do this.
sbotools has a version of this built-in:
Code:
sboremove twolame
From the manpage:
Quote:
sboremove is used to remove packages installed from slackbuilds. It pulls the list of requirements from the .info file for any specified slackbuild. If such a list exists, sboremove will look to see whether or not those requirements are installed. Those that are will then be checked to see whether they are requirements of other packages also installed. If a package is no longer required, or the -a flag is specified sboremove will ask whether or not it should also remove it from the system.
The drawback is that it will only pick up explicitly listed dependencies in .info files (so not "soft" deps). Some of the other library checking approaches given in this thread might be useful in conjunction with `sboremove`.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.