Get To Know A Command : repoquery

by rgrunber

If you ever need to hunt down some RPM metadata, but don’t want to have to install, or download the RPM(s) in question, then repoquery is your friend.

Let’s say we want to query a yum repository for a particular RPM :

$ repoquery --repofrompath=this,http://kojipkgs.fedoraproject.org/repos/rawhide/latest/i386 --repoid=this -q tycho
tycho-0:0.16.0-19.fc19.noarch

How about the set of packages that have a BuildRequire on a particular package ? We just need the source repository, and then :

$ repoquery --repofrompath=this,http://fedora.mirror.nexicom.net/linux/development/rawhide/source --repoid=this --archlist=src --whatrequires tycho
eclipse-1:4.2.1-21.fc18.src
eclipse-cdt-1:8.1.1-1.fc18.src
eclipse-dltk-0:4.0.0-2.fc18.src
eclipse-fedorapackager-0:0.4.1-2.fc18.src
eclipse-jbosstools-0:3.3.1-5.fc18.src
eclipse-linuxtools-0:1.1.1-3.fc18.src
eclipse-mylyn-0:3.8.1-2.fc18.src
eclipse-swtbot-0:2.0.5-2.20120802git.fc18.src
jacoco-0:0.5.9-1.fc18.src
swt-chart-0:0.8.0-5.fc18.src
tycho-0:0.16.0-15.fc18.src
tycho-extras-0:0.16.0-2.fc18.src

Pretty much any kind of query you could do on an RPM, you can do with repoquery against a yum repository.

I probably wouldn’t write about a command so simple (and I hope well known) in normal circumstances, but the amount of time that this command can save makes it worth a mention.

Advertisements