You are not logged in.

#1 2008-03-19 18:41:53

vit.gottwald
Member
Registered: 2008-03-19
Posts: 4

Package search by file name

Hi there,

I am wondering if there is a way to locate a particular package if I only know a name of some file it contains. The www.archlinux.org/packages seems to search only the short describtion and package name.

This is quite stupid since it happens quite often that you work with some tutorial which wants you to run some utility and you do not have it. Or you want to run a program you just dowloaded sources from and compiled them and you need a library, but you have no idea what package it might be in.

I know it is possible to look through installed packages by file name using 'pacman Qo /path/to/file'. However I would like to do the same for packages not yet installed. Moreover without having to specify the full path.

For example I am looking for 'mkfs.vfat' utility to format my usb stick.

....

I already found it to be part of dosfstools, but it was more a luck than any systematic search ...

Thanks for answers.

Vit

Offline

#2 2008-03-19 18:44:54

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: Package search by file name

Try:

pacman -Ql | grep path/to/file

Actually, i don't think i understood your question fully. Lemme think...

Last edited by dyscoria (2008-03-19 18:46:44)


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#3 2008-03-19 18:54:51

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: Package search by file name

vit.gottwald wrote:

I am wondering if there is a way to locate a particular package if I only know a name of some file it contains.

Well "pacman -Ql" would list the files owned by a package.

vit.gottwald wrote:

I know it is possible to look through installed packages by file name using 'pacman Qo /path/to/file'. However I would like to do the same for packages not yet installed.

pacman -Qo will determine what package owns a file. You can't do this for packages you haven't installed yet as a file won't be owned by a package you don't have installed. Or am I misunderstanding you?

vit.gottwald wrote:

For example I am looking for 'mkfs.vfat' utility to format my usb stick.

Is 'mkfs.vfat' a file you are looking for or a package?


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#4 2008-03-19 19:14:23

vit.gottwald
Member
Registered: 2008-03-19
Posts: 4

Re: Package search by file name

I am looking for a package which contains a particular file (in this case 'mkfs.vfat'). Then I want to install the package and run the program ('mkfs.vfat').

Offline

#5 2008-03-19 19:14:35

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Package search by file name

If you want to know it before installing the programm, you could check out the site of the german arch community, where you can list all files contained by a package. You can even search for it => click

For the non-german guys:
Name = name big_smile
Beschreibung = describtion
Datei = file <= this is, what's asked for here wink
Suchen = search

Last edited by Army (2008-03-19 19:16:20)

Offline

#6 2008-03-19 19:24:24

danielsoft
Member
From: Czech Republic
Registered: 2008-02-16
Posts: 102

Re: Package search by file name

dyscoria: I understand his point this way:

let's suppose,for example, I want the utility "glxinfo"

pacman -Ss glxinfo

gives me nothing

pacman -Ql | grep glxinfo

gives me nothing, because if I want it, logically I don't have it on my disk

the file is in package "mesa", let's suppose I don't know this, so I would want something like this

pacman -S --filename glxinfo
       extra/mesa 7.0.3rc2-1
    Mesa OpenGL library

in this case the information -that glxinfo is in mesa package- is written in the Wiki, but I chose is as an example: there are more packages which contains more than one binary utility, so it can't be named after all of them, you can use common sense to try to estimate where it is, but a feature like this can save you time


may the Source be with you

Offline

#7 2008-03-19 19:26:02

danielsoft
Member
From: Czech Republic
Registered: 2008-02-16
Posts: 102

Re: Package search by file name

Army: thanks. you replied while I was constructing my reply smile


may the Source be with you

Offline

#8 2008-03-19 19:30:53

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Package search by file name

Well, yours ist pretty good! Thanks for that!

Offline

#9 2008-03-19 19:48:40

tigrmesh
IRC Op
From: Florida, US
Registered: 2007-12-11
Posts: 794

Re: Package search by file name

Army wrote:

If you want to know it before installing the programm, you could check out the site of the german arch community, where you can list all files contained by a package. You can even search for it

Thanks.  What a great site and tutorial.  smile

Offline

#10 2008-03-19 20:47:05

vit.gottwald
Member
Registered: 2008-03-19
Posts: 4

Re: Package search by file name

Thank you guys, thats exactly what I meant and what I was looking for :-)

Do you think there is a chance that it will be any time soon available in the www.archlinux.org/packages web site or even better as a pacman option ?

Offline

#11 2008-03-19 21:51:35

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Package search by file name

http://bugs.archlinux.org/task/4824

German users are lucky smile


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#12 2008-03-19 22:08:37

miggy
Member
From: MT
Registered: 2007-11-05
Posts: 67

Re: Package search by file name

I think this was the very first post I made on these forums.  Here's what I've been doing thanks to the suggestion from byte:

Doesn't work for every package, but sometimes this Google query helps:

site:archlinux.org inurl:packages/files cdrecord (for example)

so i just have a link to a google search page with no file listed then i type in what i want and hit search

Offline

#13 2008-03-20 00:56:54

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Package search by file name

shining wrote:

Voted.

I think it's a great feature. Seems as though it will require a fair bit of hacking, though.

Offline

#14 2008-03-20 11:21:16

nDray
Member
From: Portugal
Registered: 2007-01-21
Posts: 143
Website

Re: Package search by file name

Misfit138 wrote:
shining wrote:

Voted.

I think it's a great feature. Seems as though it will require a fair bit of hacking, though.

Let me disagree... It is as simple as reading the .FILELIST... Searching for that will take a long time, though.... Maybe local [sync] database could include that file.....

Last edited by nDray (2008-03-20 11:22:34)

Offline

#15 2008-03-20 11:26:22

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Package search by file name


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#16 2008-03-20 11:39:07

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Package search by file name

I read the whole thread, and it's all good, but I couldn't shake off the fact that the OP thinks it's "quite stupid" that this facility is not available. I strongly disagree, for the simple reason that it is very easy to find out which upstream application provides a particular file using generic search methods. Once you have that, it is also very easy to find the relevant Arch package using Arch search methods.

vit.gottwald - if you think any aspect of what we're doing here is stupid, you can a) fix it and submit a patch, b) use your existing knowledge and/or skill to work around it (see above), or c) find an alternative distro with a lower stupidity level.

Offline

#17 2008-03-20 20:42:32

vit.gottwald
Member
Registered: 2008-03-19
Posts: 4

Re: Package search by file name

tomk wrote:

I read the whole thread, and it's all good, but I couldn't shake off the fact that the OP thinks it's "quite stupid" that this facility is not available. I strongly disagree, for the simple reason that it is very easy to find out which upstream application provides a particular file using generic search methods. Once you have that, it is also very easy to find the relevant Arch package using Arch search methods.

vit.gottwald - if you think any aspect of what we're doing here is stupid, you can a) fix it and submit a patch, b) use your existing knowledge and/or skill to work around it (see above), or c) find an alternative distro with a lower stupidity level.

Sorry for that. I didn't want to upset anyone. Actually arch seems to me to be the 'right' dristribution for me after trying redhat, suse, mandriva and *buntu at last. Please be a bit tolerant, I am not a native English speaker and somtimes my expressions are a bit clumsy. When I said stupid I was definitely not referring to pacman but to the process of looking for the right package I couldn't figure out. My apology and thanks to everyone's answer.

Last edited by vit.gottwald (2008-03-20 20:43:15)

Offline

Board footer

Powered by FluxBB