{"id":2280,"date":"2016-07-22T15:03:08","date_gmt":"2016-07-22T19:03:08","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2280"},"modified":"2017-11-24T15:29:31","modified_gmt":"2017-11-24T20:29:31","slug":"exclude-package-yum-update","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/","title":{"rendered":"How to Exclude a Package from yum update"},"content":{"rendered":"<h1>How to Exclude a Package from yum update<\/h1>\n<div class=\"row\">\n<div class=\"col-lg-10\">\n<p>The <a rel=\"nofollow\" href=\"http:\/\/yum.baseurl.org\/\" target=\"_blank\">yum package manager<\/a> simplifies command line administration of RPM-based distributions. While it is common to apply all available updates that yum recommends, there are circumstances where you may wish to pin a package to a specific version. For instance, maybe a newer release is incompatible with your infrastructure, or has bugs that make it unusable. Here is how to prevent yum from automatically updating a package either temporarily or permanently.<\/p>\n<\/div>\n<div class=\"col-lg-2\">\n<img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"50\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png\" alt=\"yum update\" class=\"alignright size-full wp-image-3850\" \/>\n<\/div>\n<\/div>\n<h2>Getting Started<\/h2>\n<p>This guide will work on any RPM-based distribution that uses yum as its package manager. For the purposes of learning the technique, it is best to practice on a non-production <a href=\"https:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\"><b>dedicated<\/b><\/a> or <a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\"><b>virtual server<\/b><\/a> as to not disrupt a running environment. In this example, we&#8217;ll use the httpd package. As such, you&#8217;ll either want to ensure that this package is not installed in your test environment, or that it is installed and has an update available.<\/p>\n<h2>Tutorial<\/h2>\n<p>Say you wish to permanently exclude one or more packages from automatically updating when &#8220;yum update&#8221; is used. This is achieved by editing \/etc\/yum.conf.<\/p>\n<p><code>nano \/etc\/yum.conf<\/code><\/p>\n<p>In this example, we&#8217;ll tell yum not to automatically update the httpd package. Do this by adding &#8220;exclude= httpd&#8221; to the bottom of yum.conf.<\/p>\n<p><code class=\"gris\">[main]<br \/>\ncachedir=\/var\/cache\/yum\/$basearch\/$releasever<br \/>\nkeepcache=0<br \/>\ndebuglevel=2<br \/>\nlogfile=\/var\/log\/yum.log<br \/>\nexactarch=1<br \/>\nobsoletes=1<br \/>\ngpgcheck=1<br \/>\nplugins=1<br \/>\ninstallonly_limit=5<br \/>\nbugtracker_url=http:\/\/bugs.centos.org\/set_project.php?project_id=23&ref=http:\/\/bugs.centos.org\/bug_report_page.php?category=yum<br \/>\ndistroverpkg=centos-release<\/code><\/p>\n<p><code class=\"gris\">#  This is the default, if you make this bigger yum won't see if the metadata<br \/>\n# is newer on the remote and so you'll \"gain\" the bandwidth of not having to<br \/>\n# download the new metadata and \"pay\" for it by yum not having correct<br \/>\n# information.<br \/>\n#  It is esp. important, to have correct metadata, for distributions like<br \/>\n# Fedora which don't keep old packages around. If you don't like this checking<br \/>\n# interupting your command line usage, it's much better to have something<br \/>\n# manually check the metadata once an hour (yum-updatesd will do this).<br \/>\n# metadata_expire=90m<br \/>\n# PUT YOUR REPOS HERE OR IN separate files named file.repo<br \/>\n# in \/etc\/yum.repos.d<\/code><\/p>\n<p><code>exclude= httpd <----- ADD THIS LINE WITH THE PACKAGE NAME<\/code><\/p>\n<p>You may also wish to exclude many packages from automatically updating. Do so like this:<\/p>\n<p><code>exclude= httpd php kernel*<\/code><\/p>\n<p>Let's check whether this actually worked. If you're testing with a fresh install, the httpd package shouldn't be installed. We'll install it now.<\/p>\n<p><code>[root@centos7 ~] yum install httpd<\/code><\/p>\n<p><code class=\"gris\">Loaded plugins: fastestmirror<br \/>\nbase<br \/>\nextras<br \/>\nupdates<br \/>\nLoading mirror speeds from cached hostfile<br \/>\n * base: centos.mirror.gtcomm.net<br \/>\n * extras: centos.mirror.iweb.ca<br \/>\n * updates: centos.mirror.gtcomm.net<br \/>\nNo package httpd available.<br \/>\nError: Nothing to do<\/code><\/p>\n<p>Another option is temporarily excluding an update. Say you've run \"yum update\" and see something you'd like to exclude in the list of packages. In some instances, you may wish to defer the update for only a few days while a bug is resolved upstream.<\/p>\n<p>Prevent \"yum update\" from pulling in a specific upgrade by using this command line option:<\/p>\n<p><code>yum --exclude=httpd update<\/code><\/p>\n<p>Similarly, if you wish to exclude an entire list of packages on the command line, do the following:<\/p>\n<p><code>yum --exclude=php\\* --exclude=httpd\\* --exclude=kernel\\* update<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>Ideally, upgrades always work and systems never break. But if you ever find yourself wishing to temporarily or permanently skip a broken upgrade, the above tips should be all that you need. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How to Exclude a Package from yum update The yum package manager simplifies command line administration of RPM-based distributions. While it is common to apply all available updates that yum recommends, there are circumstances where you may wish to pin a package to a specific version. For instance, maybe a newer release is incompatible with<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71],"tags":[],"class_list":["post-2280","post","type-post","status-publish","format-standard","hentry","category-applications","operating_system-centos-7"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Exclude a Package from yum update - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to exclude a package from yum update. Read now &amp; Exclude packages from automatically updating when &quot;yum update&quot; is used.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Exclude a Package from yum update - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to exclude a package from yum update. Read now &amp; Exclude packages from automatically updating when &quot;yum update&quot; is used.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-22T19:03:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-11-24T20:29:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/\",\"name\":\"How to Exclude a Package from yum update - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png\",\"datePublished\":\"2016-07-22T19:03:08+00:00\",\"dateModified\":\"2017-11-24T20:29:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you how to exclude a package from yum update. Read now & Exclude packages from automatically updating when \\\"yum update\\\" is used.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#primaryimage\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png\",\"contentUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png\",\"width\":100,\"height\":50,\"caption\":\"yum\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Exclude a Package from yum update\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Exclude a Package from yum update - Globo.Tech","description":"This tutorial will show you how to exclude a package from yum update. Read now & Exclude packages from automatically updating when \"yum update\" is used.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/","og_locale":"en_US","og_type":"article","og_title":"How to Exclude a Package from yum update - Globo.Tech","og_description":"This tutorial will show you how to exclude a package from yum update. Read now & Exclude packages from automatically updating when \"yum update\" is used.","og_url":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/","og_site_name":"Globo.Tech","article_published_time":"2016-07-22T19:03:08+00:00","article_modified_time":"2017-11-24T20:29:31+00:00","og_image":[{"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png","type":"","width":"","height":""}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/","url":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/","name":"How to Exclude a Package from yum update - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png","datePublished":"2016-07-22T19:03:08+00:00","dateModified":"2017-11-24T20:29:31+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you how to exclude a package from yum update. Read now & Exclude packages from automatically updating when \"yum update\" is used.","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/07\/Image4.png","width":100,"height":50,"caption":"yum"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/exclude-package-yum-update\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Exclude a Package from yum update"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2280"}],"version-history":[{"count":4,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2280\/revisions"}],"predecessor-version":[{"id":3851,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2280\/revisions\/3851"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}