{"id":3819,"date":"2012-09-10T22:39:03","date_gmt":"2012-09-10T14:39:03","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=3819"},"modified":"2023-04-28T09:48:59","modified_gmt":"2023-04-28T09:48:59","slug":"how-to-install-yum-priorities-on-centos-6-3","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-yum-priorities-on-centos-6-3\/","title":{"rendered":"How to Install yum-priorities on CentOS 6.3"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>YUM is a package manager used in several Linux distributions, including CentOS. It allows users to install, update, and remove packages from their systems. However, sometimes we might have multiple repositories enabled that could conflict with each other. In such cases, YUM might install a package from a less desirable repository, resulting in compatibility issues or even system crashes. To avoid such problems, we can use YUM priorities, which allows us to prioritize certain repositories over others.<\/p>\n<p>In this guide, we will show you how to install and configure the yum-priorities plugin on CentOS 6.3. This plugin enables YUM to prioritize packages from specific repositories, ensuring that the most important packages are installed first.<\/p>\n<h2>Step 1: Install yum-priorities<\/h2>\n<p>The first step is to install the yum-priorities plugin. This can be done using the following command:<\/p>\n<pre>\r\nsudo yum install yum-plugin-priorities\r\n<\/pre>\n<p>The output:<\/p>\n<pre>\r\n[root@centos63 ~]# yum install yum-priorities -y\r\nLoaded plugins: fastestmirror, presto\r\nLoading mirror speeds from cached hostfile\r\n * base: centos.ipserverone.com\r\n * extras: centos.ipserverone.com\r\n * updates: centos.ipserverone.com\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package yum-plugin-priorities.noarch 0:1.1.30-14.el6 will be installed\r\n--> Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n====================================================================================================\r\n Package                          Arch              Version                   Repository       Size\r\n====================================================================================================\r\nInstalling:\r\n yum-plugin-priorities            noarch            1.1.30-14.el6             base             22 k\r\n\r\nTransaction Summary\r\n====================================================================================================\r\nInstall       1 Package(s)\r\n\r\nTotal download size: 22 k\r\nInstalled size: 28 k\r\nDownloading Packages:\r\nSetting up and reading Presto delta metadata\r\nProcessing delta metadata\r\nPackage(s) data still to download: 22 k\r\nyum-plugin-priorities-1.1.30-14.el6.noarch.rpm                               |  22 kB     00:00\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing : yum-plugin-priorities-1.1.30-14.el6.noarch                                       1\/1\r\n  Verifying  : yum-plugin-priorities-1.1.30-14.el6.noarch                                       1\/1\r\n\r\nInstalled:\r\n  yum-plugin-priorities.noarch 0:1.1.30-14.el6\r\n\r\nComplete!\r\n<\/pre>\n<h2>Step 2: Configure yum-priorities<\/h2>\n<p>Once the plugin is installed, we need to configure it to prioritize certain repositories over others. To do this, we need to create a configuration file called \/etc\/yum\/pluginconf.d\/priorities.conf. We can do this using the following command:<\/p>\n<pre>\r\nsudo vi \/etc\/yum\/pluginconf.d\/priorities.conf\r\n<\/pre>\n<p>This will open the Vim text editor. We need to add the following lines to the file:<\/p>\n<pre>\r\n[main]\r\nenabled=1\r\ngpgcheck=1\r\n<\/pre>\n<p>These lines enable the plugin and specify that GPG checking should be performed for packages installed from repositories with priorities.<\/p>\n<h2>Step 3: Set priorities for repositories<\/h2>\n<p>Now that the plugin is installed and configured, we can set priorities for our repositories. We can do this by editing the repository configuration files in the \/etc\/yum.repos.d\/ directory. For example, if we want to give priority to the base repository, we can edit the \/etc\/yum.repos.d\/CentOS-Base.repo file and add the following lines at the end:<\/p>\n<pre>\r\npriority=1\r\n<\/pre>\n<p>This sets the priority for the base repository to 1, indicating that it should be given higher priority than other repositories.<\/p>\n<h2>Step 4: Test yum-priorities<\/h2>\n<p>Once we have configured the plugin and set priorities for our repositories, we can test that everything is working as expected. We can do this by running the following command:<\/p>\n<pre>\r\nsudo yum update\r\n<\/pre>\n<p>YUM should now give priority to packages from repositories with higher priorities. If there are conflicts, YUM will choose the package from the repository with the highest priority.<\/p>\n<h2>Commands Mentioned:<\/h2>\n<ul>\n<li><span class=\"fw-bold\">yum install<\/span> &#8211; installs a package using YUM<\/li>\n<li><span class=\"fw-bold\">sudo vi<\/span> &#8211; opens the Vim text editor with administrative privileges<\/li>\n<li><span class=\"fw-bold\">sudo yum update<\/span> &#8211; updates all packages installed on the system<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>In this guide, we have shown you how to install and configure the yum-priorities plugin on CentOS 6.3. We have also demonstrated how to set priorities for repositories and test that everything is working as expected. By using yum-priorities, we can ensure that the most important packages are installed first, reducing the risk of compatibility issues or system crashes. If you have any questions or suggestions for improvements, please leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction YUM is a package manager used in several Linux distributions, including CentOS. It allows users to install, update, and remove packages from their systems. However, sometimes we might have&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1554,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2062],"tags":[1244,1254,1536,1546,1703,1944],"class_list":["post-3819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-yum","tag-centos","tag-centos-6-3","tag-linux","tag-linux-utilities","tag-remi","tag-yum-repositories"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3819","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=3819"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3819\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1554"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=3819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=3819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=3819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}