{"id":2767,"date":"2012-05-11T21:58:39","date_gmt":"2012-05-11T13:58:39","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2767"},"modified":"2023-04-28T09:49:19","modified_gmt":"2023-04-28T09:49:19","slug":"how-to-install-and-configure-yum-priorities-on-rhel-6centos-6","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-yum-priorities-on-rhel-6centos-6\/","title":{"rendered":"How to Install and Configure yum-priorities on RHEL 6\/CentOS 6"},"content":{"rendered":"<p>In this post, i will show on how to install and configure yum-priorities on CentOS 6 or RHEL 6 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 6.2, but it may working on CentOS 6.0, CentOS 6.1 and RHEL 6 server. <\/p>\n<p>1. To Install the yum-priorities, simply run this command :<\/p>\n<pre>\n[root@centos62 ~]# yum install yum-priorities -y\n<\/pre>\n<p>Example :<\/p>\n<pre>\n[root@centos62 ~]# yum install yum-priorities -y\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: centos.ipserverone.com\n * epel: ftp.jaist.ac.jp\n * extras: centos.ipserverone.com\n * remi: iut-info.univ-reims.fr\n * remi-test: iut-info.univ-reims.fr\n * rpmforge: ftp-stud.fht-esslingen.de\n * updates: centos.ipserverone.com\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package yum-plugin-priorities.noarch 0:1.1.30-10.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package                          Arch              Version                   Repository       Size\n====================================================================================================\nInstalling:\n yum-plugin-priorities            noarch            1.1.30-10.el6             base             22 k\n\nTransaction Summary\n====================================================================================================\nInstall       1 Package(s)\n\nTotal download size: 22 k\nInstalled size: 28 k\nDownloading Packages:\nyum-plugin-priorities-1.1.30-10.el6.noarch.rpm                               |  22 kB     00:00\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\nWarning: RPMDB altered outside of yum.\n  Installing : yum-plugin-priorities-1.1.30-10.el6.noarch                                       1\/1\n\nInstalled:\n  yum-plugin-priorities.noarch 0:1.1.30-10.el6\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@centos62 ~]# more \/etc\/yum\/pluginconf.d\/priorities.conf\n<\/pre>\n<pre>\n[main]\nenabled = 1\n<\/pre>\n<p>If &#8220;<strong>enabled<\/strong>&#8221; value = 0, you can enable it using vi editor and set it to 1.<\/p>\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@centos62 ~]# 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<p>Example :<\/p>\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[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-6\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-6\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-6\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=0gpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-6\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-6\n-- INSERT --\n<\/pre>\n<p>4. As an example, another 3rd party repository is Remi. Follow this steps to Add the Remi Repository on CentOS 6\/RHEL 6 Linux Server :<br \/>\nOpen the Remi configuration file and insert &#8220;priority = 5&#8221; after &#8220;enabled = 1&#8221; in the [remi] section :<\/p>\n<pre>\n[root@centos62 ~]# vi \/etc\/yum.repos.d\/remi.repo\n<\/pre>\n<p>Example :<\/p>\n<pre>\n[remi]\nname=Les RPM de remi pour Enterprise Linux $releasever - $basearch\n#baseurl=http:\/\/rpms.famillecollet.com\/enterprise\/$releasever\/remi\/$basearch\/\nmirrorlist=http:\/\/rpms.famillecollet.com\/enterprise\/$releasever\/remi\/mirror\nenabled=1\npriority = 5\ngpgcheck=1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-remi\nfailovermethod=priority\n\n[remi-test]\nname=Les RPM de remi en test pour Enterprise Linux $releasever - $basearch\n#baseurl=http:\/\/rpms.famillecollet.com\/enterprise\/$releasever\/test\/$basearch\/\nmirrorlist=http:\/\/rpms.famillecollet.com\/enterprise\/$releasever\/test\/mirror\nenabled=1\ngpgcheck=1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-remi\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this post, i will show on how to install and configure yum-priorities on CentOS 6 or RHEL 6 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":[2062],"tags":[1244,1253,1536,1546,1703,1715,1944],"class_list":["post-2767","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-yum","tag-centos","tag-centos-6-2","tag-linux","tag-linux-utilities","tag-remi","tag-rhel-6","tag-yum-repositories"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2767","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=2767"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2767\/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=2767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}