Yum Priorities - Clarkconnect 5.0 / Centos
HOWTO - Add yum priorities plugin to ClearOS5.1 / ClarkConnect 5.0 so that additional repositories and additional packages can be added without fear of breaking your existing install
INSTALL
Cribbed from this page
http://wiki.centos.org/AdditionalResources/Repositories?action=show&redi...
Grab the yum-priorities package from
http://mirror.centos.org/centos-5/5.5/extras/i386/RPMS/yum-priorities-1....
Check plugins=1 in /etc/yum.conf
Check it is enabled in /etc/yum/pluginconf.d/priorities.conf, add check_obsoletes=1 (to prevent high priority updates being overwritten by low priority packages)
Then edit /etc/yum.repos.d/base.repo and centos.repo to reflect your priorities. Default is 99 (i.e. lowest) 1 is highest. Set everything in base.repo and centos.repo to highest by adding priority=1 after each repo. Should look like this:-
[base-os]
name=ClearOS Enterprise 5.1 - OS
baseurl=http://download.clearfoundation.com/clearos/enterprise/5.1
http://download1.clearfoundation.com/clearos/enterprise/5.1
http://download2.clearfoundation.com/clearos/enterprise/5.1
http://download3.clearfoundation.com/clearos/enterprise/5.1
http://download4.clearfoundation.com/clearos/enterprise/5.1
gpgcheck=1
priority=1
[base-console]
name=ClearOS Enterprise 5.1 - Console
baseurl=http://download.clearfoundation.com/clearos/enterprise/5.1/console
http://download1.clearfoundation.com/clearos/enterprise/5.1/console
http://download2.clearfoundation.com/clearos/enterprise/5.1/console
http://download3.clearfoundation.com/clearos/enterprise/5.1/console
http://download4.clearfoundation.com/clearos/enterprise/5.1/console
gpgcheck=1
priority=1
[base-updates]
name=ClearOS Enterprise 5.1 - Updates
baseurl=http://download.clearfoundation.com/clearos/enterprise/5.1/updates
http://download1.clearfoundation.com/clearos/enterprise/5.1/updates
http://download2.clearfoundation.com/clearos/enterprise/5.1/updates
http://download3.clearfoundation.com/clearos/enterprise/5.1/updates
http://download4.clearfoundation.com/clearos/enterprise/5.1/updates
gpgcheck=1
priority=1
[base-supplements]
name=ClearOS Enterprise 5.1 - Supplements
baseurl=http://download.clearfoundation.com/clearos/enterprise/5.1/supplements
http://download1.clearfoundation.com/clearos/enterprise/5.1/supplements
http://download2.clearfoundation.com/clearos/enterprise/5.1/supplements
http://download3.clearfoundation.com/clearos/enterprise/5.1/supplements
http://download4.clearfoundation.com/clearos/enterprise/5.1/supplements
gpgcheck=1
priority=1
[base-kernels]
name=ClearOS Enterprise 5.1 - Kernels
baseurl=http://download.clearfoundation.com/clearos/enterprise/5.1/kernels
http://download1.clearfoundation.com/clearos/enterprise/5.1/kernels
http://download2.clearfoundation.com/clearos/enterprise/5.1/kernels
http://download3.clearfoundation.com/clearos/enterprise/5.1/kernels
http://download4.clearfoundation.com/clearos/enterprise/5.1/kernels
gpgcheck=1
priority=1
[base-extras]
name=ClearOS Enterprise 5.1 - Extras
baseurl=http://download.clearfoundation.com/clearos/enterprise/5.1/extras
http://download1.clearfoundation.com/clearos/enterprise/5.1/extras
http://download2.clearfoundation.com/clearos/enterprise/5.1/extras
http://download3.clearfoundation.com/clearos/enterprise/5.1/extras
http://download4.clearfoundation.com/clearos/enterprise/5.1/extras
gpgcheck=1
enabled=0
priority=1
Do the same for /etc/yum.repos.d/centos.repo, adding priority flag also (set to 1)
[clearcentos-os]
name=ClearOS 5.x - Minified CentOS - OS
baseurl=http://download.clearfoundation.com/clearcentos/5/os
http://download1.clearfoundation.com/clearcentos/5/os
http://download2.clearfoundation.com/clearcentos/5/os
http://download3.clearfoundation.com/clearcentos/5/os
http://download4.clearfoundation.com/clearcentos/5/os
gpgcheck=1
priority=1
[clearcentos-updates]
name=ClearOS 5.x - Minified CentOS - Updates
baseurl=http://download.clearfoundation.com/clearcentos/5/updates
http://download1.clearfoundation.com/clearcentos/5/updates
http://download2.clearfoundation.com/clearcentos/5/updates
http://download3.clearfoundation.com/clearcentos/5/updates
http://download4.clearfoundation.com/clearcentos/5/updates
gpgcheck=1
priority=1
OPTIONAL - Add RPMForge / DAG, Dries, RPMFind
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Edit /etc/yum.repos.d/rpmforge.repo and add priority=70 (something low)
OPTIONAL - Add CentOSPlus. Create /etc/yum.repos.d/centos-plus-contrib.repo with:- (NOTE: Path fixed to 5.4 directory)
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/5.4/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=10
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/5.4/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=10
OPTIONAL - Add EPEL5 (Fedora EL5 compatible repo)
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarc...
Edit /etc/yum.repos.d/epel.repo to enabled=0, priority=90
Some other useful commands:-
VIEW REPO'S:
I should add that ONLY the default CC Repo's are left enabled, all other extras are disabled, unless called by the --enablerepo flag as shown in the examples below. This is additional protection against inadvertent upgrades
yum repolist all
Loading "protect-packages" plugin
Loading "priorities" plugin
repo id repo name status
base-extras ClarkConnect 5.0 - Extras disabled
base-kernels ClarkConnect 5.0 - Kernels enabled
base-os ClarkConnect 5.0 - Operating System enabled
base-supplements ClarkConnect 5.0 - Supplements enabled
base-updates ClarkConnect 5.0 - Updates enabled
centos-os CentOS 5.x - Operating System enabled
centos-updates CentOS 5.x - Updates enabled
centosplus CentOS-$releasever - Plus disabled
contrib CentOS-$releasever - Contrib disabled
rpmforge Red Hat Enterprise $releasever - RPMforg disabled
SHOW PRIORITIES:
You could add this command to /usr/local/bin/yum-priorities, and make it executable so that you don't have to remember it ;-)
sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n
priority = 1 [base-extras]
priority = 1 [base-kernels]
priority = 1 [base-os]
priority = 1 [base-supplements]
priority = 1 [base-updates]
priority = 1 [centos-os]
priority = 1 [centos-updates]
priority = 10 [centosplus]
priority = 10 [contrib]
priority = 70 [rpmforge]
TEMPORARILY ENABLE REPO:- e.g.
yum --enablerepo=* search php
yum --enablerepo=rpmforge list ntop
yum --enablerepo=epel list curl
yum --enablerepo=rpmforge install ntop
- 3968 reads
Does this work with ClearOS 5.1 too?
My question is in the topic ;-)
Best regards,
Marcus
Hi Marcus - just updated the
Hi Marcus - just updated the page so that it applies to ClearOS5.1 (which is based on RHEL5.4)
yum improvise --> error!
arrgh I got my lesson...
rpm -Uvh http://mirror.centos.org/centos-5/5.5/extras/i386/RPMS/yum-priorities-1....
"yum update
Loading "kmod" plugin
Loading "protect-packages" plugin
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 85, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
disabled_plugins=self.optparser._splitArg(opts.disableplugins))
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 162, in _getConfig
startupconf.pluginconfpath,disabled_plugins)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 314, in doPluginSetup
plugin_types, confpath, disabled_plugins)
File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 145, in __init__
self._importplugins(types)
File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 186, in _importplugins
self._loadplugin(modulefile, types)
File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 195, in _loadplugin
conf = self._getpluginconf(modname)
File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 277, in _getpluginconf
except ParsingError, e:
NameError: global name 'ParsingError' is not defined
Can you help???
Yum Update
Hi I guess I found the solution... just in case someone looking for..
rpm -rebuilddb
rpm -qa | grep yum
yum-utils-1.1.10-9.el5.centos
yum-3.2.8-9.el5.centos.1
yum-fastestmirror-1.1.10-9.el5.centos
yum-updatesd-0.9-2.el5
yum-metadata-parser-1.1.2-2.el5
yum-priorities-1.1.10-9.el5.centos
rpm -e yum-priorities
warning: /etc/yum/pluginconf.d/priorities.conf saved as /etc/yum/pluginconf.d/priorities.conf.rpmsave
yum update
Thanks. I'll use it.
Thanks. I'll use it.
Thanks
Thanks for the description. It is nice that you've mentioned that it will not break the existing install. By the way, at shares files SE http://filecraft.com I downloaded a lot of plugins.
yum priorities
i have installed the epel but
yum install yum-priorities does not install the pirorities
Post new comment