{"id":1031,"date":"2017-05-09T10:47:48","date_gmt":"2017-05-09T09:47:48","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=1031"},"modified":"2017-05-09T10:47:48","modified_gmt":"2017-05-09T09:47:48","slug":"reverting-yum-transaction-controlling-auto-updates-yum-cron-excludes","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2017\/05\/09\/reverting-yum-transaction-controlling-auto-updates-yum-cron-excludes\/","title":{"rendered":"Reverting a yum transaction &#038; controlling auto-updates for yum-cron with excludes"},"content":{"rendered":"<p>Hey, so a customer was running yum-cron, the Redhat version of Canoninical&#8217;s unattended upgrades. An auto update for a package ran, which actually broke their backend.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# yum history info 172\r\nLoaded plugins: replace, rhnplugin\r\nThis system is receiving updates from RHN Classic or Red Hat Satellite.\r\nTransaction ID : 172\r\nBegin time     : Sat May  6 05:45:29 2017\r\nBegin rpmdb    : 742:11fcb243cc5701b9d2293d90cb4161e5edc34bb8\r\nEnd time       :            05:45:31 2017 (2 seconds)\r\nEnd rpmdb      : 742:0afbbf517315f18985b2d01d4c2e5250caf0afb5\r\nUser           : root &lt;root&gt;\r\nReturn-Code    : Success\r\nTransaction performed with:\r\n    Installed     rpm-4.11.3-21.el7.x86_64                @rhel-x86_64-server-7\r\n    Installed     yum-3.4.3-150.el7.noarch                @rhel-x86_64-server-7\r\n    Installed     yum-metadata-parser-1.1.4-10.el7.x86_64 @anaconda\/7.1\r\n    Installed     yum-rhn-plugin-2.0.1-6.1.el7_3.noarch   @rhel-x86_64-server-7\r\nPackages Altered:\r\n    Updated php56u-pecl-xdebug-2.5.1-1.ius.el7.x86_64 @rackspace-rhel-x86_64-server-7-ius\r\n    Update                     2.5.3-1.ius.el7.x86_64 @rackspace-rhel-x86_64-server-7-ius\r\nhistory info\r\n<\/pre>\n<p>The customer asked us to reverse the transaction, so I did, this was quite simple to do;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&#x5B;root@web user]# yum history undo 172\r\nLoaded plugins: replace, rhnplugin\r\nThis system is receiving updates from RHN Classic or Red Hat Satellite.\r\nUndoing transaction 172, from Sat May  6 05:45:29 2017\r\n    Updated php56u-pecl-xdebug-2.5.1-1.ius.el7.x86_64 @rackspace-rhel-x86_64-server-7-ius\r\n    Update                     2.5.3-1.ius.el7.x86_64 @rackspace-rhel-x86_64-server-7-ius\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package php56u-pecl-xdebug.x86_64 0:2.5.1-1.ius.el7 will be a downgrade\r\n---&gt; Package php56u-pecl-xdebug.x86_64 0:2.5.3-1.ius.el7 will be erased\r\n--&gt; Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n============================================================================================================================================================================================================================================\r\n Package                                                  Arch                                         Version                                               Repository                                                                Size\r\n============================================================================================================================================================================================================================================\r\nDowngrading:\r\n php56u-pecl-xdebug                                       x86_64                                       2.5.1-1.ius.el7                                       rackspace-rhel-x86_64-server-7-ius                                       205 k\r\n\r\nTransaction Summary\r\n============================================================================================================================================================================================================================================\r\nDowngrade  1 Package\r\n\r\nTotal download size: 205 k\r\nIs this ok &#x5B;y\/d\/N]: y\r\nDownloading packages:\r\nDelta RPMs disabled because \/usr\/bin\/applydeltarpm not installed.\r\nphp56u-pecl-xdebug-2.5.1-1.ius.el7.x86_64.rpm                                                                                                                                                                        | 205 kB  00:00:00\r\nRunning transaction check\r\nRunning transaction test\r\nTransaction test succeeded\r\nRunning transaction\r\n  Installing : php56u-pecl-xdebug-2.5.1-1.ius.el7.x86_64                                                                                                                                                                                1\/2\r\n  Cleanup    : php56u-pecl-xdebug-2.5.3-1.ius.el7.x86_64                                                                                                                                                                                2\/2\r\n  Verifying  : php56u-pecl-xdebug-2.5.1-1.ius.el7.x86_64                                                                                                                                                                                1\/2\r\n  Verifying  : php56u-pecl-xdebug-2.5.3-1.ius.el7.x86_64                                                                                                                                                                                2\/2\r\n\r\nRemoved:\r\n  php56u-pecl-xdebug.x86_64 0:2.5.3-1.ius.el7\r\n\r\nInstalled:\r\n  php56u-pecl-xdebug.x86_64 0:2.5.1-1.ius.el7\r\n\r\nComplete!\r\n<\/pre>\n<p>In CentOS 7 and I believe RedHat RHEL 7 as well, if you don&#8217;t want to disable yum-cron altogether by running a yum remove yum-cron, you could exclude the specific package, or use wildcards to exclude all of them like php* , http*, etc.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvi \/etc\/yum\/yum-cron.conf.\r\n\r\n<\/pre>\n<p>If you wish to exclude some packages from auto-update mechanism, you&#8217;ll have to add an exclude line, at the bottom of the file, in the base section.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&#x5B;base]\r\nexclude = kernel* php* httpd*\r\n<\/pre>\n<p>etc, I hope that this is of some assist, <\/p>\n<p>cheers &#038;<br \/>\nBest wishes,<br \/>\nAdam<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, so a customer was running yum-cron, the Redhat version of Canoninical&#8217;s unattended upgrades. An auto update for a package ran, which actually broke their backend. # yum history info 172 Loaded plugins: replace, rhnplugin This system is receiving updates &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2017\/05\/09\/reverting-yum-transaction-controlling-auto-updates-yum-cron-excludes\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,98,97,88],"tags":[],"class_list":["post-1031","post","type-post","status-publish","format-standard","hentry","category-automation","category-centos","category-redhat","category-yum"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1031"}],"version-history":[{"count":1,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1031\/revisions"}],"predecessor-version":[{"id":1032,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1031\/revisions\/1032"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}