{"id":1651,"date":"2017-06-16T18:45:00","date_gmt":"2017-06-16T13:15:00","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1651"},"modified":"2026-08-25T22:57:16","modified_gmt":"2026-08-25T17:27:16","slug":"yum-roll-back-update-centos","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/yum-roll-back-update-centos\/","title":{"rendered":"How to Roll Back a YUM Update on CentOS"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Installing system updates is important for keeping a CentOS server secure and up to date. However, in some situations, a newly installed package or update may cause an application or system functionality to stop working correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the problem is directly related to a recent YUM transaction, you may be able to revert that transaction using <strong>YUM history<\/strong>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> A YUM rollback should be performed carefully on production systems. Always review the transaction before confirming the changes, and take a backup or snapshot where possible.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before rolling back a YUM transaction, make sure:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You have root or sudo access to the CentOS server.<\/li>\n\n\n\n<li>The system uses YUM for package management.<\/li>\n\n\n\n<li>You know approximately when the problematic update or installation was performed.<\/li>\n\n\n\n<li>You have identified the YUM transaction that needs to be reverted.<\/li>\n\n\n\n<li>A recent backup or server snapshot is available, especially for production systems.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Check YUM History<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First, list the previous YUM transactions:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum history<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A sample output may look like:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ID | Login user | Date and time | Action(s) | Altered\n-------------------------------------------------------\n17 | root       | 2017-06-16 03:30 | Install | 2\n16 | root       | 2017-06-16 03:28 | Install | 63\n15 | root       | 2017-06-16 03:20 | Install | 8\n14 | root       | 2017-06-15 06:18 | Install | 1\n13 | root       | 2017-06-14 02:50 | Install | 2\n12 | root       | 2017-06-12 03:43 | I, U    | 9<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Identify the transaction ID corresponding to the update or package installation that caused the issue.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Review the Transaction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before undoing a transaction, review its details.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if the transaction ID is <code>17<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum history info 17<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This allows you to see which packages were installed, updated, or removed during that transaction.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Review the transaction carefully before proceeding.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Undo the YUM Transaction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have confirmed the correct transaction ID, use:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum history undo 17<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>17<\/code> with the actual transaction ID.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">YUM will calculate the changes required to reverse the selected transaction.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Review the packages that YUM proposes to change before confirming.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Confirm the Rollback<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the proposed transaction is correct, confirm it when prompted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">YUM will then attempt to reverse the changes made by the selected transaction.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Verify the System<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After the rollback completes, verify the affected application or service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also check the YUM history again:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum history<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If a service was affected, check its status:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl status SERVICE_NAME<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>SERVICE_NAME<\/code> with the affected service.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">YUM provides transaction history that can help administrators identify and reverse recent package changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The basic workflow is:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum history\nsudo yum history info &lt;ID>\nsudo yum history undo &lt;ID><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Always review the transaction before confirming a rollback, and take a backup or server snapshot before making significant changes to a production system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. How do I see previous YUM transactions?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum history<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This displays previous package-management transactions along with their transaction IDs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. How do I check what packages were changed in a YUM transaction?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum history info &lt;ID><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum history info 17<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Installing system updates is important for keeping a CentOS server secure and up to date. However, in some situations, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[161,349],"class_list":["post-1651","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-centos","tag-yum","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-qD","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1651"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1651\/revisions"}],"predecessor-version":[{"id":11062,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1651\/revisions\/11062"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}