Ask Your Question

Locate in yum repos

asked 2011-10-26 06:12:32 -0600

lzap gravatar image


I am looking for a tool that would work the similar way as the slocate/mlocate, but against files in yum repositories. I sometimes need to find a file in Fedora repos, but yum is quite slow. I would rather give up some free hdd space.

Basically what I need is to extract all the files from a repo, I could use grep then. Something like:

# ylocate bash
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-10-26 11:30:14 -0600

Elad Alfassa gravatar image

updated 2011-10-27 09:10:39 -0600

yum provides *bash*


zif search-file /bin/bash

(I should make zif search-file accept just part of the path, and not just the whole path, which will make it do exactly what you want, and fast)

edit flag offensive delete link more


Yeah, I am looking for something faster. But thanks!

lzap gravatar imagelzap ( 2011-10-27 04:16:45 -0600 )edit

answered 2011-11-08 09:39:08 -0600

skvidal gravatar image

The part that makes yum take a while is downloading the repodata - specifically the filelists repodata is quite large. If you want to do this less often you can increase the value of metadata_expire in your /etc/yum.conf under [main].

Or if you want to not have to wait at all - setup a cron job to update your metadata every day or half-day or so - then you'll be more likely to be completely current and never have to wait.

You can run something like: # yum clean expire-cache; yum makecache

as root.

that will download all the repodata for any enabled repo and save it.

Then the next time you run yum or repoquery as a user or as root it will all be ready to go and waiting for you.

edit flag offensive delete link more

answered 2011-10-28 22:58:29 -0600

You could also try 'repoquery':

repoquery -qf /bin/bash

edit flag offensive delete link more


Looks good

lzap gravatar imagelzap ( 2011-11-09 10:09:42 -0600 )edit

Question Tools


Asked: 2011-10-26 06:12:32 -0600

Seen: 713 times

Last updated: Nov 08 '11