[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 如何找到某个文件的宿主包?



Vern Sun 已经说了不要 dpkg -S

>>>> 在07-3-3,*Vern Sun* < s5unty@gmail.com <mailto:s5unty@gmail.com>>
>>>> 写道:
>>>>
>>>>     因为我要找的不是本机上安装的deb包,所以dpkg -S是不行的。

zhanglong wrote:
> 搜寻拥有该文件(或多个文件)的包。
> vo-debian-ext:/usr# dpkg -S /usr/lib/jvm /usr/lib/jvm/java-gcj
> java-gcj-compat: /usr/lib/jvm
> java-gcj-compat: /usr/lib/jvm/java-gcj
> 
> vo-debian-ext:/usr# dpkg -S /usr/lib/j2sdk1.5-sun
> sun-j2sdk1.5: /usr/lib/j2sdk1.5-sun
> 
> 
>> examples:
>>
>> debian:~# apt-file update
>> debian:~# apt-file find /usr/sbin/exim4
>> exim4-daemon-heavy: usr/sbin/exim4
>> exim4-daemon-heavy-dbg: usr/lib/debug/usr/sbin/exim4
>> exim4-daemon-light: usr/sbin/exim4
>> exim4-daemon-light-dbg: usr/lib/debug/usr/sbin/exim4
>>
>> Bin Tian wrote:
>>
>>> debian:~# apt-cache show apt-file
>>> Package: apt-file
>>> Priority: optional
>>> Section: admin
>>> Installed-Size: 96
>>> Maintainer: Sebastien J. Gross <sjg@debian.org>
>>> Architecture: all
>>> Version: 2.0.8.2
>>> Depends: perl, wget | curl, gzip (>= 1.2.4), libconfig-file-perl,
>>> libapt-pkg-perl
>>> Suggests: ssh, sudo
>>> Filename: pool/main/a/apt-file/apt-file_2.0.8.2_all.deb
>>> Size: 12902
>>> MD5sum: 369114261071e005a8b54b250208fb91
>>> SHA1: ebab2159475c5699cd56a731afbe534bfa285061
>>> SHA256: 0b53d7f7d28bbe957e3eb2289d033c2ae6f6932459bd97f1d503b8bbb03eb970
>>> Description: APT package searching utility -- command-line interface
>>>  apt-file is a command line tool for searching packages for the APT
>>>  packaging system.
>>>  .
>>>  _*Unlike apt-cache, you can search in which package a file is included
>>>  or list the contents of a package without installing or fetching it.*_
>>>  .
>>>  Please read README file for curl or wget instructions.
>>> Tag: implemented-in::perl, interface::commandline, role::program,
>>> suite::debian, use::searching, works-with::file,
>>> works-with::software:package
>>>
>>> debian:~#
>>>
>>>
>>> Vern Sun wrote:
>>>
>>>> find -type f -exec echo "=========================" "{}" \; -exec
>>>> dpkg -c "{}" \; | less +/somefile
>>>>
>>>> 在07-3-3,*Vern Sun* < s5unty@gmail.com <mailto:s5unty@gmail.com>>
>>>> 写道:
>>>>
>>>>     因为我要找的不是本机上安装的deb包,所以dpkg -S是不行的。
>>>>
>>>>     假设在/sun目录下多个deb包,其中一个含有文件somefile,我用
>>>>     find -type f -exec dpkg -c "{}" \; | less +/somefile,能找到该文
>>>>     件。但是dpkg -c不会列出包名,所以我还是不知道somefile属于哪个包?
>>>>
>>>>     不用脚本能否实现,如果要写脚本,应该怎样写?谢谢!
>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>> Vern 
>>>
> 
> 



Reply to: