View previous topic :: View next topic |
Author |
Message |
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Thu Dec 09, 2010 9:00 am Post subject: [SOLVED] Finding package for a given program? |
|
|
I'm running an application which requires "dc" (calculator), but it's not installed on my system.
How do I find out which package "dc" is a part of?
Last edited by pgu on Fri Dec 10, 2010 10:21 am; edited 1 time in total |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Dec 09, 2010 9:10 am Post subject: |
|
|
Code: | $ qfile /usr/bin/dc
sys-devel/bc (/usr/bin/dc) | For installed packages, qfile or equery belongs, from app-portage/portage-utils and app-portage/gentoolkit respectively; for packages that are not installed, asking seems to be the most reliable approach. |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Thu Dec 09, 2010 9:43 am Post subject: |
|
|
desultory wrote: | Code: | $ qfile /usr/bin/dc
sys-devel/bc (/usr/bin/dc) | For installed packages, qfile or equery belongs, from app-portage/portage-utils and app-portage/gentoolkit respectively; for packages that are not installed, asking seems to be the most reliable approach. |
Thanks. But I can't get equery to tell me the location of dc:
Code: | # equery belongs dc
[ Searching for file(s) dc in *... ] |
gives no result? |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Dec 09, 2010 10:47 am Post subject: |
|
|
As expected, given that it is not currently installed.
The program you appear to be seeking is provided as part of sys-devel/bc. |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Thu Dec 09, 2010 3:17 pm Post subject: |
|
|
desultory wrote: |
The program you appear to be seeking is provided as part of sys-devel/bc. |
Yes, I got that from your previous post (again, thank you). But I was hoping to find a method to get the package name of any given program/file I would like to install, which is not currently installed on the machine. |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Fri Dec 10, 2010 6:37 am Post subject: |
|
|
Providing comprehensive coverage with such a service would be quite difficult to do, given that changes in USE flags frequently change what programs are installed as part of any given package. Between that, the frequent changes to the main tree and the moving target provided by any attempt to include overlays it has never, to my knowledge, been fully implemented. However, there was a partial implementation, after a fashion, as part of one of the tinderbox systems; if it is still present and I can find it, I will post a link to it. |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Fri Dec 10, 2010 10:21 am Post subject: |
|
|
I understand. But a emerge could keep a database of all installed files and the associated package. |
|
Back to top |
|
|
avendesora Veteran
Joined: 16 Aug 2002 Posts: 1739 Location: Betelgeuse vicinity
|
Posted: Fri Dec 10, 2010 10:51 am Post subject: |
|
|
It does, see desultory's first reply in this thread. |
|
Back to top |
|
|
BitJam Advocate
Joined: 12 Aug 2003 Posts: 2508 Location: Silver City, NM
|
Posted: Fri Dec 10, 2010 12:47 pm Post subject: |
|
|
pgu wrote: | Thanks. But I can't get equery to tell me the location of dc:
Code: | # equery belongs dc
[ Searching for file(s) dc in *... ] |
gives no result? |
That is because you did not give an absolute path to the program you were inquiring about. Try: Code: | $ equery belongs $(which bc) |
I use that so often, I made a bash function called "what": Code: | what () {
equery belongs $(which $1)
} |
|
|
Back to top |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
Posted: Fri Dec 10, 2010 1:18 pm Post subject: |
|
|
It works without an absolute path now too:
Code: | $ equery belongs dc
[ Searching for file(s) dc in *... ]
sys-devel/bc-1.06.95 (/usr/bin/dc)
|
_________________ Search | Read | Answer | Report | Strip |
|
Back to top |
|
|
marens Apprentice
Joined: 05 Aug 2004 Posts: 173
|
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Mon Mar 28, 2011 3:27 pm Post subject: |
|
|
Thanks marens. Quite often I find that I need to install a tool I've used before (like dc). But I have no idea of the package or where gentoo would keep it (/bin, /usr/bin/, /sbin/ etc). |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Sat Jan 05, 2013 6:06 pm Post subject: |
|
|
Hmm. I can't get this to work now. I would like to install "dig". I first tried:
Code: | # equery belongs dig
* Searching for dig ...
sys-kernel/gentoo-sources-3.5.7 (/usr/src/linux-3.5.7-gentoo/arch/ia64/dig)
sys-kernel/gentoo-sources-3.6.11 (/usr/src/linux-3.6.11-gentoo/arch/ia64/dig)
|
Which does not make sense as the dig I'm looking for is similar to nslookup and has nothing to do with the kernel. Then I located it on an older system:
Code: | type dig
dig is /usr/bin/dig |
and tried to locate the package on my recent system without any luck:
Code: | # equery belongs /usr/bin/dig
* Searching for /usr/bin/dig ... |
|
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Sat Jan 05, 2013 6:10 pm Post subject: |
|
|
I found it as a part of bind-tools, but I would like to find a method in which I can find the package a given binary or library belongs too... |
|
Back to top |
|
|
dol-sen Retired Dev
Joined: 30 Jun 2002 Posts: 2805 Location: Richmond, BC, Canada
|
Posted: Sat Jan 05, 2013 9:30 pm Post subject: |
|
|
It is working for me... Code: | brian@big_daddy ~/Dev/git/gentoolkit $ equery belongs dig
* Searching for dig ...
net-dns/bind-tools-9.9.2 (/usr/bin/dig)
sys-kernel/gentoo-sources-3.2.1 (/usr/src/linux-3.2.1-gentoo/arch/ia64/dig)
sys-kernel/gentoo-sources-3.4.3 (/usr/src/linux-3.4.3-gentoo/arch/ia64/dig)
sys-kernel/gentoo-sources-3.4.4 (/usr/src/linux-3.4.4-gentoo/arch/ia64/dig)
sys-kernel/gentoo-sources-3.5.4 (/usr/src/linux-3.5.4-gentoo/arch/ia64/dig)
sys-kernel/gentoo-sources-3.6.2 (/usr/src/linux-3.6.2-gentoo/arch/ia64/dig)
sys-kernel/gentoo-sources-3.6.6 (/usr/src/linux-3.6.6-gentoo/arch/ia64/dig)
sys-kernel/zen-sources-9999 (/usr/src/linux-3.99-zen0/arch/ia64/dig)
brian@big_daddy ~/Dev/git/gentoolkit $ |
equery's belongs module is for precisely what you are wanting. It only works for currently installed files and packages though. Also, since the above query was quite generic by specifying "dig" it listed all occurrences of a file called "dig" in my system. It is up to the user to decide which one is the one he/she wanted.
hmm, side note, time to clean out some old kernels...
For finding out what pkg a file belongs to in general, even if not installed. There is app-portage/pfl and it's website where you can do queries to find out what pkg you need to install to get the file/functionality you were looking for. _________________ Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch... |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Wed Jan 16, 2013 5:57 pm Post subject: |
|
|
thank you dol-sen. The web site has the information I was looking for. |
|
Back to top |
|
|
|