[TriLUG] resolving a dependency

paul peeler paul at enetx.net
Tue Apr 13 14:43:28 EDT 2004


My apologies, if you want to search for a particular file inside of a
package, there is another way with apt-cache, and it is in the man page,
just looked to confirm myself.

'#apt-cache search regex' gives you the option to search with a regular
expression and it will tell you what package/s contain that file, as
well as the --version option can tell you version numbers if that isn't
obvious in the name. You can simply use the name of the file to match
that exactly.

[root at mybox root]# apt-cache search libxml2.so.2
libxml2 - Library providing XML and HTML support

hopefully this is what you were looking for, if not....

In regard to the other:

I may have misunderstood what you were asking before, but if you want to
install package abc123, then you could '#apt-cache depends abc123'. You
don't have to know the name of the package that holds the dependency,
you have to know the name of the package that you want to install. See
below for actual output. It would return to you the packages that it
depended on or the files it needed (libsomething.so) and the package/s
that contain those files. Seemingly a more complete way of looking at
dependencies. Pipe it through grep if you like.

Side note: If the package tree you are using doesn't contain the ackage
necessary to resolve the issue, then seemingly apt/yum can not resolve
it for you either, and you are right back at google anyway?

Below is output from the command using the package 'pan' as the example.
This a Fedora Core 1 machine using the more than adequate version of apt
that atrpms provides. The depends line shows the file it needs, and the
one or more lines below each show the package or packages it could use
to solve that dependency. Not as direct as the yum command, but achieves
the same result. If you are looking for a file as a dependency to a
package that you want to install from your sources, this would be a good
way to find it. Otherwise, use the 'search' option.

[root at mybox root]# apt-cache depends pan
pan-1:0.14.2.91-2.rhfc1.dag
  Depends: <libaspell.so.15>
    aspell-12:0.50.3-16
  Depends: <libatk-1.0.so.0>
    atk-1.6.0-1.1.fc2.nr
  Depends: <libc.so.6>
    glibc-2.3.2-101.4
  Depends: <libc.so.6(GLIBC_2.0)>
    glibc-2.3.2-101.4
  Depends: <libc.so.6(GLIBC_2.1)>
    glibc-2.3.2-101.4
  Depends: <libc.so.6(GLIBC_2.2)>
    glibc-2.3.2-101.4
  Depends: <libc.so.6(GLIBC_2.3)>
    glibc-2.3.2-101.4
  Depends: <libdl.so.2>
    glibc-2.3.2-101.4
  Depends: <libgdk-x11-2.0.so.0>
    gtk2-2.4.0-1.1.fc2.nr
  Depends: <libgdk_pixbuf-2.0.so.0>
    gtk2-2.4.0-1.1.fc2.nr
  Depends: <libglib-2.0.so.0>
    glib2-2.4.0-1.1.fc2.nr
  Depends: <libgmodule-2.0.so.0>
    glib2-2.4.0-1.1.fc2.nr
  Depends: <libgnet-2.0.so.0>
    gnet-1:2.0.4-1
    gnet2-2.0.5-1.rhfc1.dag
  Depends: <libgobject-2.0.so.0>
    glib2-2.4.0-1.1.fc2.nr
  Depends: <libgthread-2.0.so.0>
    glib2-2.4.0-1.1.fc2.nr
  Depends: <libgtk-x11-2.0.so.0>
    gtk2-2.4.0-1.1.fc2.nr
  Depends: <libgtkspell.so.0>
    gtkspell-2.0.4-2
  Depends: <libm.so.6>
    glibc-2.3.2-101.4
  Depends: <libpango-1.0.so.0>
    pango-1.4.0-1.1.fc2.nr
  Depends: <libpangox-1.0.so.0>
    pango-1.4.0-1.1.fc2.nr
  Depends: <libpangoxft-1.0.so.0>
    pango-1.4.0-1.1.fc2.nr
  Depends: <libpcre.so.0>
    pcre-4.4-1
  Depends: <libpcreposix.so.0>
    pcre-4.4-1
  Depends: <libpthread.so.0>
    glibc-2.3.2-101.4
    valgrind-2.0.0-1.rhfc1.dag
  Depends: <libpthread.so.0(GLIBC_2.0)>
    glibc-2.3.2-101.4
    valgrind-2.0.0-1.rhfc1.dag
  Depends: <libxml2.so.2>
    libxml2-2.6.8-1.1.fc2.nr
  Depends: <libz.so.1>
    zlib-1.2.0.7-2



On Tue, 2004-04-13 at 12:08, Michael Thompson wrote:
> On Tue, 2004-04-13 at 11:27, paul peeler wrote:
> > #apt-cache depends package-name
> > this will return the package-name's dependencies and what packages can
> > satisfy them.
> 
> That works, but you have to know the package name first.  
> 
> Is there a way to do a search for a package that *contains*
> <file_name>?  I can do this with yum, but apt does not seem to have
> that function.  If a particular app I'm compiling needs foo.so, but
> I dont know what foo.so is, or what other package it comes with, I'm
> stuck until I find it on google and find out what package its included
> in.  (Or installing yum, which has hosed my system a couple of times,
> so I dont like using it)
> 
> man apt, man apt-cache has given me no clues.  (Unless I've missed
> something)
> 
> --mike
> 
> ______________________________________________________________________
> -- 
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc




More information about the TriLUG mailing list