Priorities
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
[main]
enabled=1
$ sudo vi /etc/yum.conf
Add this line
plugins=1
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.
[base]
priority=1
exclude=php* kernel*
[update]
exclude=(exclude packages you dont want updating)
priority=1
[centosplus]
enabled=1
priority=2
[contrib]
enabled=1
priority=2
![]() |
Centos 6/RHEL Priorities settings restrictions |
Third Party Repos
Some of the third party repos which are available.
Epel
$ sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
(Same package for 64 bit)
Puias
$ sudo rpm --import http://puias.princeton.edu/data/puias/6/i386/os/RPM-GPG-KEY-puias
(Same key for 64 bit)
$ sudo vi /etc/yum.repos.d/PUIAS_6_addons_2.repo put in it
[PUIAS_6_addons_2]
name=PUIAS addons Base $releasever - $basearch - 2
#mirrorlist=http://www.puias.princeton.edu/data/puias/$releasever/$basearch/os/Addons/mirrorlist
baseurl=http://www.math.ias.edu/data/puias/$releasever/$basearch/os/Addons
enabled=0
gpgcheck=1
Remi (PHP related and others, must have Epel also)
$ sudo yum -y install wget
$ wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
$ sudo rpm -Uvh remi-release-6.rpm
RpmFusion
$ su -c 'yum -y localinstall --nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm'
(Enter password at prompt)
or go to http://rpmfusion.org/Configuration to find the current commands as they change often.
Elrepo
$ sudo rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
$ sudo rpm -Uvh http://elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
RPMForge
$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
Naulinux
$ sudo vi /etc/yum.repos.d/naulinux-school.repo
Enter into the file
[naulinux-school]
name=NauLinux School
baseurl=http://downloads.naulinux.ru/pub/NauLinux/6.2/$basearch/sites/School/RPMS/
enabled=0
gpgcheck=1
gpgkey=http://downloads.naulinux.ru/pub/NauLinux/RPM-GPG-KEY-linux-ink
Save the file and run yum
Nux-dextop
$ sudo yum -y install wget
$ wget http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-1.el6.nux.noarch.rpm
or
$ wget http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-1.el6.nux.noarch.rpm
Then install the downloaded repo pack
$ sudo rpm -Uvh nux-dextop-release-0-1.el6.nux.noarch.rpm
VirtualBox
Create a blank repo file
$ sudo vi /etc/yum.repos.d/virtualbox.repo
Enter into the file
[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
Save the file and run yum
Atrpms
$ sudo rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms
$ sudo rpm -Uvh http://packages.atrpms.net/dist/el6/atrpms-repo/atrpms-repo-6-6.el6.i686.rpm
$ sudo rpm -Uvh http://packages.atrpms.net/dist/el6/atrpms-repo/atrpms-repo-6-6.el6.x86_64.rpm
$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
Naulinux
$ sudo vi /etc/yum.repos.d/naulinux-school.repo
Enter into the file
[naulinux-school]
name=NauLinux School
baseurl=http://downloads.naulinux.ru/pub/NauLinux/6.2/$basearch/sites/School/RPMS/
enabled=0
gpgcheck=1
gpgkey=http://downloads.naulinux.ru/pub/NauLinux/RPM-GPG-KEY-linux-ink
Save the file and run yum
Nux-dextop
$ sudo yum -y install wget
$ wget http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-1.el6.nux.noarch.rpm
or
$ wget http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-1.el6.nux.noarch.rpm
Then install the downloaded repo pack
$ sudo rpm -Uvh nux-dextop-release-0-1.el6.nux.noarch.rpm
VirtualBox
Create a blank repo file
$ sudo vi /etc/yum.repos.d/virtualbox.repo
Enter into the file
[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
Save the file and run yum
Atrpms
$ sudo rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms
$ sudo rpm -Uvh http://packages.atrpms.net/dist/el6/atrpms-repo/atrpms-repo-6-6.el6.i686.rpm
$ sudo rpm -Uvh http://packages.atrpms.net/dist/el6/atrpms-repo/atrpms-repo-6-6.el6.x86_64.rpm
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
$ 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 : http://li.nux.ro/
Group : Applications/Internet
URL : http://deluge-torrent.org/
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.
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 : http://li.nux.ro/
Group : Applications/Internet
URL : http://deluge-torrent.org/
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
package
--envra show epoch:name-version-release.architecture info of
package
--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
--alldeps
--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
--grouppkgs=GROUPPKGS
filter which packages (all,optional etc) are shown
from groups
--archlist=ARCHLIST only query packages of certain architecture(s)
--releasever=RELEASEVER
set value of $releasever in yum config and repo files
--pkgnarrow=PKGNARROW
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
--enablerepo=ENABLEREPOS
specify additional repos to query.
--disablerepo=DISABLEREPOS
specify repos to disable
--repofrompath=REPOFROMPATH
specify repoid & paths of additional repositories -
unique repoid and complete path required Example.
--repofrompath=myrepo,/path/to/repo
--plugins enable yum plugin support
--quiet quiet output, only error output to stderr (default
enabled)
--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
-c CONFFILE, --config=CONFFILE
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=SEARCHFIELDS
search fields to search using --search
thanks Paul, it helps a lot on my Centos6 repo.
ReplyDelete