Re: finding a package name given a filename
*- Eric Jacoboni wrote about "Re: finding a package name given a filename"
> Nuno Carvalho <nemanuel@student.dei.uc.pt> writes:
>
>
>> Didn't you want to know on what package was as86 extracted!?
>> as86 belongs to the bin86 package !!
>>
>> I think that's what you want!
>
> Yep, you're right ;-)
>
> _But_ try to do a :
>
> $ dpkg -S xemacs
>
> And you will see all an unnecessary garbage instead of just the
> package name from which the xemacs executable has been extracted...
>
The problem with a lot of packages is that the executable is linked
from a shorter name, and the links are not part of the package but are
created in the postinst scripts. The xemacs example is a really good
one.
/usr/bin/xemacs -> /etc/alternatives/xemacs
/etc/alternatives/xemacs -> /usr/bin/xemacs20
/usr/bin/xemacs20 -> /etc/alternatives/xemacs20
/etc/alternatives/xemacs20 -> /usr/bin/xemacs-20.4-nomule (finally!!!)
So doing a 'dpkg -S /usr/bin/xemacs' would not work because
/usr/bin/xemacs is actually not in the xemacs20-nomule package but is
created after the package is extracted.
> Nevermind, i've resolved the problem :
>
> $ dpkg -S xemacs|grep '/usr/bin/xemacs'
> xemacs20-nomule: /usr/bin/xemacs-20.4-nomule
>
> or,
>
> $ dpkg -S as86 |grep `which as86`
> bin86: /usr/bin/as86
>
> That's ok for me... Thanks again.
You can skip the grep
% dpkg -S `which as86`
bin86: /usr/bin/as86
which means you can just enter the full path.
% dpkg -S /usr/bin/as86
bin86: /usr/bin/as86
--
Brian
---------------------------------------------------------------------
"Never criticize anybody until you have walked a mile in their shoes,
because by that time you will be a mile away and have their shoes."
- unknown
Mechanical Engineering servis@purdue.edu
Purdue University http://www.ecn.purdue.edu/~servis
---------------------------------------------------------------------
Reply to: