{"id":2230,"date":"2012-03-12T20:24:17","date_gmt":"2012-03-12T12:24:17","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2230"},"modified":"2023-04-28T09:49:41","modified_gmt":"2023-04-28T09:49:41","slug":"how-to-install-and-configure-yum-priorities-on-centos-5rhel-5-linux-server","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-yum-priorities-on-centos-5rhel-5-linux-server\/","title":{"rendered":"How to Install and Configure yum-priorities on CentOS 5\/RHEL 5 Linux Server"},"content":{"rendered":"<p>In this post, i will show on how to install and configure yum-priorities on CentOS 5 or RHEL 5 Linux server. Theoretically, the repositories with the lowest numerical priority number have the highest priority. This is one of the method to prevents mistakes such as accidentally running yum upgrade with everything. This steps has been tested on CentOS 5.7, but it may working on CentOS 5.1, CentOS 5.2, CentOS 5.4, CentOS 5.5, CentOS 5.6 and RHEL 5. <\/p>\n<p>1. To Install the yum-priorities, simply run this command :<\/p>\n<pre>\n[root@CentOS57 ~]# yum install yum-priorities -y\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirror.oscc.org.my\n * extras: mirror.oscc.org.my\n * rpmforge: ftp-stud.fht-esslingen.de\n * updates: mirror.oscc.org.my\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package yum-priorities.noarch 0:1.1.16-21.el5.centos set to be updated\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package                   Arch              Version                          Repository       Size\n====================================================================================================\nInstalling:\n yum-priorities            noarch            1.1.16-21.el5.centos             base             16 k\n\nTransaction Summary\n====================================================================================================\nInstall       1 Package(s)\nUpgrade       0 Package(s)\n\nTotal download size: 16 k\nDownloading Packages:\nyum-priorities-1.1.16-21.el5.centos.noarch.rpm                               |  16 kB     00:00\nRunning rpm_check_debug\nRunning Transaction Test\nFinished Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing     : yum-priorities                                                               1\/1\n\nInstalled:\n  yum-priorities.noarch 0:1.1.16-21.el5.centos\n\nComplete!\n<\/pre>\n<p>2. After the plugin is installed, make sure that it is enabled on \/etc\/yum\/pluginconf.d\/priorities.conf file.<\/p>\n<pre>\n[root@CentOS57 ~]# cat \/etc\/yum\/pluginconf.d\/priorities.conf\n[main]\nenabled = 1\n<\/pre>\n<p>If enabled = 0, you can enabled it using vi editor as below :<\/p>\n<pre>\n[root@CentOS57 ~]# vi \/etc\/yum\/pluginconf.d\/priorities.conf\n<\/pre>\n<p>3. With the plugin enabled, you may add priorities to the target repositories by adding the following line :<\/p>\n<pre>\npriority=N\n<\/pre>\n<p>Where N is an integer from 1 to 99. The lower the number the more important it is, so CentOS-Base.repo must always the lowest.<\/p>\n<pre>\n[root@CentOS57 ~]# vi \/etc\/yum.repos.d\/CentOS-Base.repo\n<\/pre>\n<p>Add this line on base repo :<\/p>\n<pre>\npriority = 1\n<\/pre>\n<pre>\n# CentOS-Base.repo\n#\n# The mirror system uses the connecting IP address of the client and the\n# update status of each mirror to pick mirrors that are updated to and\n# geographically close to the client.  You should use this for CentOS updates\n# unless you are manually picking other mirrors.\n#\n# If the mirrorlist= does not work for you, as a fall back you can try the\n# remarked out baseurl= line instead.\n#\n#\n\n\n[base]\nname=CentOS-$releasever - Base\nmirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=os\n#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/os\/$basearch\/\ngpgcheck=1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-5\npriority = 1\n\n#released updates\n[updates]\nname=CentOS-$releasever - Updates\nmirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=updates\n#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/updates\/$basearch\/\ngpgcheck=1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-5\n\n#additional packages that may be useful\n[extras]\nname=CentOS-$releasever - Extras\nmirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=extras\n#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/extras\/$basearch\/\ngpgcheck=1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-5\n\n#additional packages that extend functionality of existing packages\n[centosplus]\nname=CentOS-$releasever - Plus\nmirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=centosplus\n#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/centosplus\/$basearch\/\ngpgcheck=1\nenabled=0\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-5\n\n#contrib - packages by Centos Users\n[contrib]\nname=CentOS-$releasever - Contrib\nmirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=contrib\n#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/contrib\/$basearch\/\ngpgcheck=1\nenabled=0\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-5\n<\/pre>\n<p>4. As an example, another 3rd party repository is RPMforge. Follow this steps to Add the RPMforge Repository on CentOS 5\/RHEL 5 Linux Server :<br \/>\n<a href=\"https:\/\/webhostinggeeks.com\/howto\/how-to-add-the-rpmforge-repository-on-centos-5rhel-5-linux-server\/\">How to Add the RPMforge Repository on CentOS 5\/RHEL 5 Linux Server<\/a><\/p>\n<p>Open the RPMforge configuration file and insert &#8220;priority = 5&#8221; after &#8220;enabled = 1&#8221; in the [rpmforge] section :<\/p>\n<pre>\n[root@CentOS57 ~]# vi \/etc\/yum.repos.d\/rpmforge.repo\n<\/pre>\n<p>In this case, i will add the fifth highest possible priority which is &#8220;priority=5&#8221; :<\/p>\n<pre>\n### Name: RPMforge RPM Repository for RHEL 5 - dag\n### URL: http:\/\/rpmforge.net\/\n[rpmforge]\nname = RHEL $releasever - RPMforge.net - dag\nbaseurl = http:\/\/apt.sw.be\/redhat\/el5\/en\/$basearch\/rpmforge\nmirrorlist = http:\/\/apt.sw.be\/redhat\/el5\/en\/mirrors-rpmforge\n#mirrorlist = file:\/\/\/etc\/yum.repos.d\/mirrors-rpmforge\nenabled = 1\npriority = 5\nprotect = 0\ngpgkey = file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-rpmforge-dag\ngpgcheck = 1\n\n[rpmforge-extras]\nname = RHEL $releasever - RPMforge.net - extras\nbaseurl = http:\/\/apt.sw.be\/redhat\/el5\/en\/$basearch\/extras\nmirrorlist = http:\/\/apt.sw.be\/redhat\/el5\/en\/mirrors-rpmforge-extras\n#mirrorlist = file:\/\/\/etc\/yum.repos.d\/mirrors-rpmforge-extras\nenabled = 0\nprotect = 0\ngpgkey = file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-rpmforge-dag\ngpgcheck = 1\n\n[rpmforge-testing]\nname = RHEL $releasever - RPMforge.net - testing\nbaseurl = http:\/\/apt.sw.be\/redhat\/el5\/en\/$basearch\/testing\nmirrorlist = http:\/\/apt.sw.be\/redhat\/el5\/en\/mirrors-rpmforge-testing\n#mirrorlist = file:\/\/\/etc\/yum.repos.d\/mirrors-rpmforge-testing\nenabled = 0\nprotect = 0\ngpgkey = file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-rpmforge-dag\ngpgcheck = 1\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this post, i will show on how to install and configure yum-priorities on CentOS 5 or RHEL 5 Linux server. Theoretically, the repositories with the lowest numerical priority number&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1499,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,2062],"tags":[1244,1248,1536,1726,1944],"class_list":["post-2230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-yum","tag-centos","tag-centos-5-7","tag-linux","tag-rpmforge","tag-yum-repositories"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=2230"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2230\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1499"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}