LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   checking if a package is used by other apps (https://www.linuxquestions.org/questions/linux-general-1/checking-if-a-package-is-used-by-other-apps-333510/)

pbhj 06-14-2005 12:02 PM

checking if a package is used by other apps
 
Hi All,

I'm using Slack 10, but this seems to be sufficiently general to go here:

I was doing some updates with a Slackware package manager called swaret (there's also slapt-get!). I noticed a package related to CORBA is installed which I don't think I am using. anything from.

If I'm not using it then I'd like to remove the package.

I was wondering how to check that no app installed is dependent on this package at all. Kind of the reverse of ldd.

"ldd" finds packaged which the stated package depends on. I want to find what depends on the stated package.

I did think of running ldd against all installed binaries and then grepping the output for the CORBA libraries. I got as far as "ldd -v `locate /bin` | grep ORB" but this seems suboptimal

Surely there's a better way?

Any suggestions?

jonaskoelker 06-15-2005 09:03 AM

Quote:

"ldd" finds packaged which the stated package depends on.
Doesn't it find shared libs which the executable depends on?

In Debian (and thus most likely slapt-get) each package has a reverse-depends section (i.e. x reverse-depends on y iff y depends on x).

Then it becomes a trivial matter of checking if any package in reverse-depends(x) is installed.

hth --Jonas

pbhj 06-18-2005 04:58 PM

Yeah, you're right of course on the ldd front (it's executables and libraries).

However, slapt-get doesn't do what I want as Slackware packages don't (by default) include dependency information.

>>>slapt-get can only attempt to resolve dependencies and
conflicts for those packages that were built with this
information. Vanilla Slackware packages (ie official
Slackware packages) do not contain this data, thus slapt-
get performs with --no-dep on by default.

Anyone else ...

jonaskoelker 06-18-2005 09:51 PM

Quote:

don't (by default) include dependency information... Vanilla Slackware packages (ie official Slackware packages) do not contain this data
:O

... doesn't that defeat (at least half of) the purpose of a package manager?

And I wouldn't know of a smarter algorithm that solves your problem than you got yourself :(

Sorry

--Jonas

Tinkster 06-18-2005 10:27 PM

In terms of package management, that's how Pat has done
it/is doing it (and Slack *is* the oldest living distro). The
approach I would take if I faced the problem would be
slightly less brute-force...
Code:

for i in `egrep -e "(bin/.+|lib/.+)" <package> | sed 's@^@/@'|xargs -i ldd {} | grep -v " not "|awk '{print $1}' |sort -u `;do grep $i /var/log/packages/* ; done


Cheers,
Tink


All times are GMT -5. The time now is 07:13 AM.