LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-01-2021, 09:25 AM   #1
xj25vm
Member
 
Registered: Jun 2008
Posts: 393

Rep: Reputation: 68
Reverse/backward dependency checking in Slackware


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
 
Old 04-01-2021, 09:33 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
SlackBuilds.org offers a reverse dependency check actually. Using twolame as an example: https://slackbuilds.org/advsearch.ph...e&stype=revdep.
 
5 members found this post helpful.
Old 04-01-2021, 10:42 AM   #3
EdGr
Senior Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 1,005

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Run ldd on all executable programs and libraries. Grep for the library you are interested in.

Code:
for n in /usr/bin/*; do if (ldd $n | grep -q lame); then echo $n; fi; done
Ed
 
1 members found this post helpful.
Old 04-01-2021, 11:28 AM   #4
SpacePlod
Member
 
Registered: Jan 2014
Distribution: Slackware
Posts: 115

Rep: Reputation: Disabled
If I understand your question correctly, you might give hoorex a try (on SBo: https://slackbuilds.org/repository/14.2/misc/hoorex/)

Code:
$ hoorex --help
...

This program shows which other packages require a given SBo package

...

$ hoorex twolame
twolame bombono-dvd vlc soundconverter
 
1 members found this post helpful.
Old 04-01-2021, 12:13 PM   #5
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
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)

Code:
# grep speex /var/lib/sbopkg/queues/*
/var/lib/sbopkg/queues/FlightGear.sqf:@speex
/var/lib/sbopkg/queues/TiMidity++.sqf:@speex
/var/lib/sbopkg/queues/ffmpeg.sqf:@speex
/var/lib/sbopkg/queues/libshout.sqf:@speex
/var/lib/sbopkg/queues/speex.sqf:speex
/var/lib/sbopkg/queues/vlc.sqf:@speex
This example is of course for sbopkg. I believe most SBo automated tools have some way of specifying dependencies (required, optional, and/or both).

(My queue files generally only list first-level dependencies, so I'd have to do further searching to find all dependent packages on speex).
 
1 members found this post helpful.
Old 04-01-2021, 12:17 PM   #6
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
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
 
1 members found this post helpful.
Old 04-01-2021, 01:21 PM   #7
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,552

Rep: Reputation: 8565Reputation: 8565Reputation: 8565Reputation: 8565Reputation: 8565Reputation: 8565Reputation: 8565Reputation: 8565Reputation: 8565Reputation: 8565Reputation: 8565
Here's a little something I use around here.
Attached Files
File Type: txt find-whatlinksagainst.sh.txt (4.9 KB, 231 views)
 
14 members found this post helpful.
Old 04-01-2021, 03:41 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by volkerdi View Post
Here's a little something I use around here.
Knowing the scripts I've created to help my processes, it'd be really interesting to see your collection of scripts you've created over the years.

I'm not actually asking for them, just more of a showerthought.
 
Old 04-04-2021, 12:32 PM   #9
xj25vm
Member
 
Registered: Jun 2008
Posts: 393

Original Poster
Rep: Reputation: 68
Thank you everyone for the suggestions - most helpful!

Quote:
Originally Posted by Alien Bob View Post
SlackBuilds.org offers a reverse dependency check actually. Using twolame as an example: https://slackbuilds.org/advsearch.ph...e&stype=revdep.
Thank you - I didn't realise that.

Quote:
Originally Posted by EdGr View Post
Run ldd on all executable programs and libraries. Grep for the library you are interested in.

Code:
for n in /usr/bin/*; do if (ldd $n | grep -q lame); then echo $n; fi; done
Ed
I guess if some binaries are under /opt or elsewhere, the above wouldn't catch them?

Quote:
Originally Posted by SpacePlod View Post
If I understand your question correctly, you might give hoorex a try (on SBo: https://slackbuilds.org/repository/14.2/misc/hoorex/)
Does hoorex return packages from the entire SBo list, or only SBo packages already installed locally?

Quote:
Originally Posted by drumz View Post
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 View Post
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
...
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 View Post
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
 
Old 04-04-2021, 12:45 PM   #10
EdGr
Senior Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 1,005

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Quote:
Originally Posted by xj25vm View Post
I guess if some binaries are under /opt or elsewhere, the above wouldn't catch them?
Yes, you need to search all executables and libraries. I was showing you how to do that. My point was that one line of Bash can do what you want.
Ed
 
1 members found this post helpful.
Old 04-04-2021, 05:10 PM   #11
chris.willing
Member
 
Registered: Jun 2014
Location: Sydney, Australia
Distribution: Slackware,LFS
Posts: 920

Rep: Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623
Quote:
Originally Posted by xj25vm View Post
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.
chris
 
1 members found this post helpful.
Old 04-04-2021, 06:10 PM   #12
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware
Posts: 490

Rep: Reputation: Disabled
Quote:
Originally Posted by volkerdi View Post
Here's a little something I use around here.
In 119 lines of Bash code, 2 pages of x86 RAM...

You, Sir, have yet again made some magic.

Now, let us lesser magicians study his methods.
 
1 members found this post helpful.
Old 04-05-2021, 02:45 AM   #13
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,221

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
Quote:
Originally Posted by xj25vm View Post
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`.

Last edited by drgibbon; 04-05-2021 at 02:48 AM.
 
Old 04-05-2021, 05:50 AM   #14
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,989

Rep: Reputation: 1563Reputation: 1563Reputation: 1563Reputation: 1563Reputation: 1563Reputation: 1563Reputation: 1563Reputation: 1563Reputation: 1563Reputation: 1563Reputation: 1563
I don't think sbbdep has been mentioned yet. I find it quite useful.

"sbbdep --whoneeds [query]"
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mouse's forward and backward (side buttons) slackware 14.1 tautvilas Slackware 0 01-18-2014 09:44 PM
New Slackware 14 backward compatibility vdemuth Slackware 9 09-23-2012 07:18 PM
Dependency checking this, dependency checking that. Jeebizz General 11 09-29-2009 06:51 PM
dependency checking in slackware? hottdogg Slackware 8 09-02-2006 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration