get package name from file name

2011-07-07 Thread Joao Ferreira Gmail
Hello,

how can I tell which package installs a given file ?

something like:

# find-package-from-file /usr/lib/libxml2.so.2
libxml2

thx
jmf



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1310030553.2380.2.ca...@wheejy.critical.pt



Re: get package name from file name

2011-07-07 Thread kuLa
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/07/11 10:22, Joao Ferreira Gmail wrote:
 Hello,
 
 how can I tell which package installs a given file ?
 
 something like:
 
 # find-package-from-file /usr/lib/libxml2.so.2
 libxml2

hi,
dpkg is your friend :-)

dpkg -S /usr/lib/libxml2.so.2

- -- 

|_|0|_|  |
|_|_|0| Heghlu'Meh QaQ jajVam  |
|0|0|0|  kuLa -  |

gpg --keyserver pgp.mit.edu --recv-keys 0xC100B4CA
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOFXtpAAoJEOqHloDBALTKHB8IAJmR7W/FyIkq1j58FZ+MAkrp
E2un18zvxi6v+8QFQIPkNHa04wk61O8cvmhlbUk/HqZlNxV/2pVGLzb8d2k1WynE
rGhJzpHD841A85yQDgzg7ShyN318fVWFHBQLZUGRqitPFTKUqqkO6Dm92Nywgmzm
YfhvbNHFjp6lZnpm4s937vaD1WKe1/q6P/pX7tfqwJ+mAaSxNGnmPqy1jgIJSYuA
CBcnh5mWbfFqH0i40aJQcKmT9FkTtkR57cut3weBzvegFfboXmNrsgjRnm7lHaBY
hQDOpBW7c8w0LGF25Ya8f4ZgXPbobx2gu7IF6Pq3d8zYbN0wdU0tvgmQmOrhcgY=
=MqR/
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4e157b69.4070...@kulisz.net



Re: get package name from file name

2011-07-07 Thread Joao Ferreira Gmail
On Thu, 2011-07-07 at 10:24 +0100, kuLa wrote:
 dpkg -S /usr/lib/libxml2.so.2

cool. thx

Joao



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1310031477.2380.3.ca...@wheejy.critical.pt



Re: get package name from file name

2011-07-07 Thread Wolodja Wentland
On Thu, Jul 07, 2011 at 10:22 +0100, Joao Ferreira Gmail wrote:
 how can I tell which package installs a given file ?
 something like:
 
 # find-package-from-file /usr/lib/libxml2.so.2
 libxml2

As always there are multiple to do this :)

* dpkg -S /path/to/file
* apt-file search /path/to/file
* dlocate -S /path/to/file

I prefer to use either apt-file or dlocate. The former comes in quite handy as
it also works for packages that are not installed and it supports regular
expressions. If you are looking for an executable, but don't know the full
path you can search for:

$ apt-file search -x bin/foo$

which will find all files named foo that are in a bin/ directory somewhere.
In particular this will not match bin/foobar. dlocate on the other hand is a
bit faster than dpkg -S and has other goodies too ... have a look.

have fun
-- 
  .''`. Wolodja Wentlandbabi...@gmail.com
 : :'  :
 `. `'` 4096R/CAF14EFC
   `-   081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC


signature.asc
Description: Digital signature


Re: get package name from file name

2011-07-07 Thread kuLa
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/07/11 13:17, Wolodja Wentland wrote:
 As always there are multiple to do this :)
 
 * dpkg -S /path/to/file
 * apt-file search /path/to/file
 * dlocate -S /path/to/file
 
 I prefer to use either apt-file or dlocate. The former comes in quite handy as
 it also works for packages that are not installed and it supports regular
 expressions. If you are looking for an executable, but don't know the full
 path you can search for:
 
 $ apt-file search -x bin/foo$
 
 which will find all files named foo that are in a bin/ directory somewhere.
 In particular this will not match bin/foobar. dlocate on the other hand is a
 bit faster than dpkg -S and has other goodies too ... have a look.
 
 have fun

Yeee, many ways to the same goal but dlocate or apt-file aren't present
in Debian by default like dpkg is :-)

- -- 

|_|0|_|  |
|_|_|0| Heghlu'Meh QaQ jajVam  |
|0|0|0|  kuLa -  |

gpg --keyserver pgp.mit.edu --recv-keys 0xC100B4CA
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOFajwAAoJEOqHloDBALTKcHEIAIQNi9szfQeX5yLTji0JD+af
LcWnXh2Y7I/Q57d1S5FVM1c69n8PkIfBZD+zXmqy5Y3hzZvPBDv6b8RCz8EY3aQq
Ht1ViDI1A6A4WuZev3f2BmxS/XxajU8nJYLD11++coIADWNohaycq7LhKEPciBxh
JWG+hbC8L+vx13qRsgGGHl0oO15+ZigeKYykaBXe4kSxl/gZRgKFEQGZiHn2DQ6Y
0wZ2Arw0jtKrv6Zp6d0hDGQM7/9SG+dCLF32yXRzxRlTZ9m0tjNKD4EGVy/89Ogh
wZviLhKXdn89dBv4c1zGNI08n3uIm9yX3HXz8rVprspGP7JTKLe1RLrt25UJcQc=
=yWg6
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4e15a8f0.60...@kulisz.net



Re: get package name from file name

2011-07-07 Thread lee
Joao Ferreira Gmail joao.miguel.c.ferre...@gmail.com writes:

 how can I tell which package installs a given file ?

apt-file search given file


-- 
html messages are obsolete


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87mxgq4381@yun.yagibdah.de



Re: get package name from file name

2011-07-07 Thread Camaleón
On Thu, 07 Jul 2011 10:37:57 +0100, Joao Ferreira Gmail wrote:

 On Thu, 2011-07-07 at 10:24 +0100, kuLa wrote:
 dpkg -S /usr/lib/libxml2.so.2
 
 cool. thx

And for packages that are not installed in your system you can use the 
online query (package contents) which avoids the needing of installing 
apt-file :-):

http://packages.debian.org/search?suite=stablesection=allarch=anysearchon=contentskeywords=%2Fusr%2Flib%2Flibxml2.so.2

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/pan.2011.07.07.14.42...@gmail.com



Re: get package name from file name

2011-07-07 Thread Wolodja Wentland
On Thu, Jul 07, 2011 at 13:39 +0100, kuLa wrote:
 On 07/07/11 13:17, Wolodja Wentland wrote:
  As always there are multiple to do this :)
  
  * dpkg -S /path/to/file
  * apt-file search /path/to/file
  * dlocate -S /path/to/file
  
  I prefer to use either apt-file or dlocate. The former comes in quite handy 
  as
  it also works for packages that are not installed and it supports regular
  expressions. If you are looking for an executable, but don't know the full
  path you can search for:
  
  $ apt-file search -x bin/foo$
  
  which will find all files named foo that are in a bin/ directory 
  somewhere.
  In particular this will not match bin/foobar. dlocate on the other hand 
  is a
  bit faster than dpkg -S and has other goodies too ... have a look.

 Yeee, many ways to the same goal but dlocate or apt-file aren't present
 in Debian by default like dpkg is :-)

Sure, but that applies for a lot of software. :) I typically don't have a
problem to install packages I want, but YMMV. It is just that dpkg -S is
only useful when you try to figure out where a file on your system came from,
not which package you have to install in order to get a specific one.

I find that I need to figure out the latter much more often, hence my
recommendations. But this is moot as you are probably aware of all this and I
can just stop now.

Slainte!
-- 
  .''`. Wolodja Wentlandbabi...@gmail.com
 : :'  :
 `. `'` 4096R/CAF14EFC
   `-   081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC


signature.asc
Description: Digital signature


Re: get package name from file name

2011-07-07 Thread Kamaraju S Kusumanchi
Wolodja Wentland wrote:

 On Thu, Jul 07, 2011 at 10:22 +0100, Joao Ferreira Gmail wrote:
 how can I tell which package installs a given file ?
 something like:
 
 # find-package-from-file /usr/lib/libxml2.so.2
 libxml2
 
 As always there are multiple to do this :)
 
 * dpkg -S /path/to/file
 * apt-file search /path/to/file
 * dlocate -S /path/to/file

another way is 
wajig whichpkg /path/to/file

raju
-- 
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/iv5mvs$ih6$1...@dough.gmane.org



Re: get package name from file name

2011-07-07 Thread William Hopkins
On 07/07/11 at 09:43pm, Wolodja Wentland wrote:
 On Thu, Jul 07, 2011 at 13:39 +0100, kuLa wrote:
  On 07/07/11 13:17, Wolodja Wentland wrote:
   As always there are multiple to do this :)
   
   * dpkg -S /path/to/file
   * apt-file search /path/to/file
   * dlocate -S /path/to/file
   
   I prefer to use either apt-file or dlocate. The former comes in quite 
   handy as
   it also works for packages that are not installed and it supports regular
   expressions. If you are looking for an executable, but don't know the full
   path you can search for:
   
   $ apt-file search -x bin/foo$
   
   which will find all files named foo that are in a bin/ directory 
   somewhere.
   In particular this will not match bin/foobar. dlocate on the other hand 
   is a
   bit faster than dpkg -S and has other goodies too ... have a look.
 
  Yeee, many ways to the same goal but dlocate or apt-file aren't present
  in Debian by default like dpkg is :-)
 
 Sure, but that applies for a lot of software. :) I typically don't have a
 problem to install packages I want, but YMMV.

You make good points but it is always a useful policy to familiarize yourself
with, and make a habit of recommending the packages guaranteed to be installed
for portability/reliability.

Also some of us are somewhat OCD and hate having ten packages installed with
overlapping featuresets :P

-- 
Liam


signature.asc
Description: Digital signature