Changes from Version 1 of RepoQuery

skvidal (IP:
06/22/10 14:22:46 (8 years ago)



  • RepoQuery

    v0 v1  
     1= Repoquery use = 
     3Repoquery is a yum-util that has an array of involved and complicated options. It is intended to be an analog to rpm -q commands but run on remote repositories. This accounts for why it is complicated and involved :) This page has a series of common/useful commands someone may want to use repoquery for. 
     5== Enabling repositories == 
     7By default repoquery acts on the repositories you have enabled in your yum configuration. You can enable/disable repos by using --enablerepo=repoid or --disablerepo=repoid. Occasionally you'll just want to query a single repo, when that happens you can use repoquery --repoid=repoid. Then ONLY that repository will be enabled, no matter your yum configuration. 
     9Often you may find yourself wanting to query a repo that is NOT set up in your yum configuration. Repoquery handles that case specifically with --repofrompath: {{{ repoquery  --repofrompath=somereponame,http://path/to/this/repo --repoid=somereponame  -q -a }}} 
     11== Specifying archs == 
     13Repoquery can work on any arch but by default it uses the arches for the system it is running on. However, if you want to specify an arch for it to use you can use --archlist. Some examples: 
     15Only query i686 pkgs, nothing else: 
     16{{{ repoquery -q --archlist=i686 -a }}} 
     18Query i686 and i386 pkgs: 
     19{{{ repoquery -q --archlist=i686,i386 -a }}} 
     21Look at source rpms: 
     22{{{ repoquery -q --archlist=src -a }}} 
     25== Searching for answers == 
     27If you need to figure out what in the repos requires any thing from a particular package run: 
     29{{{ repoquery -q --whatrequires --alldeps pkgname }}}  
     30  (in new versions of repoquery --alldeps is the default) 
     32If you need to figure out which srpms have a buildrequirement on a particular pkgname run: 
     34{{{ repoquery --archlist=src --repoid=some_repo_with_srpms -q --whatrequires pkgname }}} 
     36Using repoquery on installed packages only: 
     37{{{ repoquery --pkgnarrow=installed -q --whatrequires --alldeps pkgname }}} 
     38That is the equivalent of: rpm -q --whatrequires pkgname 
     41== Formatting output == 
     43If you need to print out a list of pkgs, their url from the repo and the repo they came from you could run: 
     45{{{ repoquery -q --qf="%{name} %{repoid} %{location}" pkg1 pkg2 pkg3 }}}