which package a file belongs to

frmas frmas at free.fr
Sun Jan 18 10:11:34 UTC 2009


Ansgar Burchardt a écrit :
>> I'm looking for the tool (dpkg ?) and command line parameters, that will
>> give me the package (name and version), a file on my HD belongs to.
>> Something like :
>> dpkg --search | grep /usr/bin/nedit ??
>>
>> Result : nedit_1.5.5-2ubuntu3.deb
> 
> The command `dpkg -S /usr/bin/nedit' will tell you the package name and
> then you can use `dpkg -l [package]' to get the installed version.

yes, that could do the trick.
I've tried to optimize that, but I failed. I don't know how to get rid
of those little ":" at the end of the name. This is my command line :
 dpkg -S /usr/bin/nedit | dpkg -l `awk '{print $1}'`
but awk returns "nedit:" ;-(
I do not know how to remove those ":".... Francois




More information about the ubuntu-users mailing list