Friday, 17 May 2013

Centos 6/RHEL install additional Repositories & Priorities

Here is a list of repos which are useful for extra packages while building up your system. You can use them manually and have them set at disabled until you need them or you can experiment with yum priorities which is the recommended way. Using priorities you can control which repo gets used if multiple repos supply the same packages. If using yum priorities you will need to perform some tasks to start with.


First obtain the priorities & yum-utils packages for Centos 6.

$ sudo yum -y install yum-plugin-priorities yum-utils

Now add lines to the two conf files

$ sudo vi /etc/yum/pluginconf.d/priorities.conf

Add this line


$ sudo vi /etc/yum.conf 

Add this line


Check out vi commands if needed

Simple priority usage is by adding a line in each repo file

$ sudo vi /etc/yum.repos.d/<reponame>.repo

priority=1                       Greatest priority

priority=99                      Lowest priority

Any repo not assigned a priority number will default to 99.

But it can become a little more complex, see the link above.

You can play around with the priorities settings for the repos you have installed, with the more useful ones set at around 10-20 and the less used ones set at 40-50 & with the include an exclude flags.

Read the manual for additional yum commands as you proceed, especially the 'includepkgs=' and/or 'exclude=' options.

$ man yum
$ man yumdb
$ man yum.conf 

Centos Repos

You can search an invidual repos contents by disabling them all and enabling the one you want to view, first get a list of your installed repos, repolist may not list all of them so

$ yum repolist                  or if some are excluded

$ ls /etc/yum.repos.d/

$ yum --disablerepo=\* --enablerepo=nux-dextop list all

You can enable additional Centos repos in the base repo file

$ sudo vi /etc/yum.repos.d/CentOS-Base.repo

Scroll down, for example, to enable centosplus or contrib and set enabled to 1.

You can then set priorities on each with the exclude= command to filter out packages you don't require in a space separated list.

exclude=php* kernel* 
exclude=(exclude packages you dont want updating)



Centos 6/RHEL Priorities settings restrictions

Third Party Repos

Some of the third party repos which are available.


$ sudo  rpm -Uvh

(Same package for 64 bit)


$ sudo rpm --import  

(Same key for 64 bit)

$ sudo vi /etc/yum.repos.d/PUIAS_6_addons_2.repo    put in it

name=PUIAS addons Base $releasever - $basearch - 2


Remi (PHP related and others, must have Epel also)

$ sudo yum -y install wget
$ wget 
$ sudo rpm -Uvh remi-release-6.rpm


$ su -c 'yum -y localinstall --nogpgcheck'

(Enter password at prompt)

or go to to find the current commands as they change often.


$ sudo rpm --import 

$ sudo  rpm -Uvh


$ sudo rpm -Uvh

$ sudo rpm -Uvh


$ sudo vi /etc/yum.repos.d/naulinux-school.repo

Enter into the file

name=NauLinux School

Save the file and run yum


$ sudo yum -y install wget                           
$ wget
$ wget

Then install the downloaded repo pack       


$ sudo rpm -Uvh nux-dextop-release-0-1.el6.nux.noarch.rpm  


Create a blank repo file

$ sudo vi /etc/yum.repos.d/virtualbox.repo

Enter into the file

name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox

Save the file and run yum 


 $ sudo rpm --import 

$ sudo rpm -Uvh

$ sudo rpm -Uvh

If you are not using priorities, disable them to avoid conflicts, but leave EPEL enabled.

As there will be more than one repo file just

$ yum repolist
$ sudo vi /etc/yum.repos.d/<repo_name>  (set enabled to 0)

To find out information on any available package just query it.

$ repoquery -i gedit          (search default repos)

$ repoquery -i --enablerepo=nux-dextop deluge (additional repo)

$ repoquery -i --repoid=nux-dextop deluge (just one repo)

 Name        : deluge
Version     : 1.3.3
Release     : 1.el6.nux
Architecture: noarch
Size        : 0
Packager    :
Group       : Applications/Internet
URL         :
Repository  : nux-dextop
Summary     : A GTK+ BitTorrent client with support for DHT, UPnP, and PEX
Source      : deluge-1.3.3-1.el6.nux.src.rpm
Description :
Deluge is a new BitTorrent client, created using Python and GTK+. It is
intended to bring a native, full-featured client to Linux GTK+ desktop
environments such as GNOME and XFCE. It supports features such as DHT
(Distributed Hash Tables), PEX (ĀµTorrent-compatible Peer Exchange), and UPnP
(Universal Plug-n-Play) that allow one to more easily share BitTorrent data
even from behind a router with virtually zero configuration of port-forwarding.

You can also use 

$ yum list available gedit

$ yum list available | grep gedit

More examples of repoquery & yum
See the list of repoquery commands below.

Repoquery Options:

 --version             show program’s version number and exit

 -h, --help            show this help message and exit

 -l, --list            list files in this package/group

 -i, --info            list descriptive info from this package/group

 -f, --file            query which package provides this file

 --qf=QUERYFORMAT, --queryformat=QUERYFORMAT

                       specify a custom output format for queries

 --groupmember         list which group(s) this package belongs to

 -q, --query           no-op for rpmquery compatibility

 -a, --all             query all packages/groups

 -R, --requires        list package dependencies

 --provides            list capabilities this package provides

 --obsoletes           list other packages obsoleted by this package

 --conflicts           list capabilities this package conflicts with

 --changelog           show changelog for this package

 --location            show download URL for this package

 --nevra               show name-epoch:version-release.architecture info of


 --envra               show epoch:name-version-release.architecture info of


 --nvr                 show name, version, release info of package

 -s, --source          show package source RPM name

 --srpm                operate on corresponding source RPM

 --resolve             resolve capabilities to originating package(s)

 --alldeps             check non-explicit dependencies (files and Provides:)

                       as well, defaults to on

 --exactdeps           check dependencies exactly as given, opposite of


 --recursive           recursively query for packages (for whatrequires)

 --whatprovides        query what package(s) provide a capability

 --whatrequires        query what package(s) require a capability

 --whatobsoletes       query what package(s) obsolete a capability

 --whatconflicts       query what package(s) conflicts with a capability

 -g, --group           query groups instead of packages


                       filter which packages (all,optional etc) are shown

                       from groups

 --archlist=ARCHLIST   only query packages of certain architecture(s)


                       set value of $releasever in yum config and repo files


                       limit query to installed / available / recent /

                       updates / extras / all (available + installed)/

   repository (default) packages

--installed           limit query to installed pkgs only

 --show-duplicates     show all versions of packages

 --show-dupes          show all versions of packages

 --repoid=REPOID       specify a repo to query 


                       specify additional repos to query.


                       specify repos to disable


                       specify repoid & paths of additional repositories -

                       unique repoid and complete path required Example.


 --plugins             enable yum plugin support

 --quiet               quiet output, only error output to stderr (default


 --verbose             verbose output (opposite of quiet)

 -C, --cache           run from cache only

 --tempcache           use private cache (default when used as non-root)

 --querytags           list available tags in queryformat queries


                       config file location

 --tree-requires       list recursive requirements, in tree form

 --tree-conflicts      list recursive conflicts, in tree form

 --tree-obsoletes      list recursive obsoletes, in tree form

 --tree-whatrequires   list recursive what requires, in tree form

 --search              Use yum’s search to return pkgs


                       search fields to search using --search

1 comment:

  1. thanks Paul, it helps a lot on my Centos6 repo.