kubuntu-users Digest, Vol 19, Issue 24

jakykong at theanythingbox.com jakykong at theanythingbox.com
Thu Aug 17 13:43:38 UTC 2006


>On Wednesday 16 August 2006 15:11, D. R. Evans wrote:
>> I have a simple question. Suppose that I want to install a package that
>> will install a particular file, X. How do I determine which package will
>> provide the file X?
>
>Not really what you asked, but may be useful. If you want to know what 
>*installed* package has file X you do:
>
>$  dpkg -S X
>
>(no sudo needed)
>
>I don't think there's a built-in way to find filenames of non-installed 
>packages. Apparently the cache simply doesn't store that information. Note 
>that this was actually needed in RPM-based distributions because the 
>dependencies (at least until rpm v3, maybe v4) were not smart enough to tell

>you what packages you needed. The information RPM gave you was "I need file 
>X", and you had to somewhat to find a package with that file. We don't
suffer 
>from this problem.
>
>Of course, if there *IS* a way to find, I would like to be proven wrong.
>
>regards
>FF

Well, you're right. There is no built-in way to do this (that i know of)....
but there is a perfectly easy way to do this!
apt-file is a program that was made specifically to do this. Just install it:
$sudo apt-get install apt-file
then to find particular file X, do this:
first, update apt-file (it has a db like apt-get, but it's not the same one)
$sudo apt-file update
then, search for your file in installed AND uninstalled packages:
$sudo apt-file list X
show works instead of list if you perfer it :-) the output should be a list
of all files matching your query in all the packages.

Hope it helps!
-Jakykong




More information about the kubuntu-users mailing list