[plug] command to check package association

Anthony J. Breeds-Taurima tony at cantech.net.au
Mon Aug 26 10:32:42 WST 2002


On 25 Aug 2002, Jon L. Miller wrote:

> Is there a command that can check the association of a package to a
> program? Need to find out if by upgrading a package if it'll have any
> effects on a program that it may be associated with.

Assuming your talking about a binary executeable you could do something like:
~$ ldd /bin/ls
        libc.so.6 => /lib/libc.so.6 (0x4001c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

You now know that /bin/ls requires /lib/libc.so.6 and /lib/ld-linux.so.2

So then you do:

~$ for i in /lib/libc.so.6 /lib/ld-linux.so.2 ; do rpm -qf $i ; ldd $i ; done
glibc-2.1.3-23
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
glibc-2.1.3-23
        statically linked

Which tells you that both libraries are in glibc-2.1.3-23 and don't depend on
libraries outside that package.  It would be hard to think that an upgrade to
anything other than glibc-2.1.3-23 would hurt /bin/ls

You would need to repeat this for all libraries your binary touches.  
Of course this doesn't help you if your program is reading /proc/pci and you
upgrade your kernel then it may well break.

You should also combine this with
rpm -q --whatrequires ....... ; 
rpm -q --whatprovides ....... ; and
rpm -q --requires     .......

For completeness you could also do:
~$ strings /bin/ls | grep \/
/lib/ld-linux.so.2
<=u/
:-t/
/usr/share/locale
//DIRED//
//SUBDIRED//
//DIRED-OPTIONS// --quoting-style=%s
  -F, --classify             append indicator (one of */=@|) to entries
  -p, --file-type            append indicator (one of /=@|) to entries
%m/%d/%y

That will show you that /bin/ls, has something to do with "/usr/share/locale"

really it depends on how hard you want to look at the problem.


Yours Tony

   Jan 22-25 2003           Linux.Conf.AU            http://linux.conf.au/
		  The Australian Linux Technical Conference!



More information about the plug mailing list