{"id":12141,"date":"2019-03-22T11:53:17","date_gmt":"2019-03-22T11:53:17","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12141"},"modified":"2019-03-22T11:53:17","modified_gmt":"2019-03-22T11:53:17","slug":"how-to-undo-or-redo-a-yum-install-on-centos-and-rhel","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/22\/how-to-undo-or-redo-a-yum-install-on-centos-and-rhel\/","title":{"rendered":"How to Undo or Redo a Yum Install on CentOS and RHEL"},"content":{"rendered":"<p>One of the most important and useful feature added to\u00a0<a href=\"https:\/\/www.tecmint.com\/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement\/\" target=\"_blank\" rel=\"noopener\">YUM Package Manager<\/a>\u00a0(from version\u00a0<strong>3.2.25<\/strong>) is the \u2018<strong>yum history<\/strong>\u2019 command. It allows you to review a full history of yum transactions that have been run on a system.<\/p>\n<p>It shows the dates and times when a transactions were performed, whether the transactions succeeded or were aborted, the number of packages affected, and so much more.<\/p>\n<p>Importantly,\u00a0<strong>yum history<\/strong>\u00a0can be used to\u00a0<strong>undo<\/strong>\u00a0or\u00a0<strong>redo<\/strong>\u00a0certain transactions. In this article, we will show how to\u00a0<strong>undo<\/strong>\u00a0or\u00a0<strong>redo<\/strong>\u00a0a yum install including dependencies on a\u00a0<strong>CentOS\/RHEL<\/strong>\u00a0distribution.<\/p>\n<p>To do this, first you need to review the yum transactions history by running the following command as\u00a0<strong>root<\/strong>\u00a0user, otherwise use the\u00a0<a href=\"https:\/\/www.tecmint.com\/run-sudo-command-without-password-linux\/\" target=\"_blank\" rel=\"noopener\">sudo command<\/a>\u00a0to gain root privileges.<\/p>\n<pre>$ sudo yum history  \r\nOR\r\n$ sudo yum history list all\r\n<\/pre>\n<div id=\"attachment_30658\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/09\/List-Yum-History.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30658\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/09\/List-Yum-History.png\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/09\/List-Yum-History.png 802w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/09\/List-Yum-History-768x475.png 768w\" alt=\"List Yum History\" width=\"802\" height=\"496\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">List Yum History<\/p>\n<p>From the output in the screenshot above, the\u00a0<strong>yum history<\/strong>\u00a0shows you the transaction ID, the command line, date and time, action and more.<\/p>\n<p>To undo a\u00a0<strong>yum install<\/strong>, take note of the\u00a0<strong>transaction ID<\/strong>, and perform the required action. In this example, we want to undo the install with\u00a0<strong>ID 63<\/strong>, which will erase the package that was installed in the specified transaction, as follows (enter<code> y\/yes<\/code>\u00a0when asked).<\/p>\n<pre>$ sudo yum history undo 63\r\n<\/pre>\n<div id=\"attachment_30659\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/09\/undo-yum-install.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30659\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/09\/undo-yum-install.png\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/09\/undo-yum-install.png 802w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/09\/undo-yum-install-768x675.png 768w\" alt=\"Undo Yum Install Package\" width=\"802\" height=\"705\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Undo Yum Install Package<\/p>\n<\/div>\n<p>To\u00a0<strong>redo<\/strong>\u00a0a yum install, as before, take note of the\u00a0<strong>transaction ID<\/strong>, and run it. For instance to redo the install with\u00a0<strong>ID 63<\/strong>, run the the following command.<\/p>\n<pre>$ sudo yum history redo 63\r\n<\/pre>\n<p>Note that you can do the same for a\u00a0<strong>yum remove\/erase transaction<\/strong>. The most important thing to note is the\u00a0<strong>transaction ID<\/strong>\u00a0of an\u00a0<strong>yum install<\/strong>\u00a0or\u00a0<strong>yum remove<\/strong>\u00a0action.<\/p>\n<p>For more information about yum history, see this guide:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/view-yum-history-to-find-packages-info\/\" target=\"_blank\" rel=\"noopener\">How to Use \u2018Yum History\u2019 to Find Out Installed or Removed Packages Info<\/a><\/li>\n<\/ol>\n<p>That\u2019s all for now! In this article, we demonstrated how to undo or redo a yum install including dependencies on CentOS\/RHEL. Share your thoughts with us via the comment form below.<\/p>\n<p><a style=\"font-size: 1rem;\" href=\"https:\/\/www.tecmint.com\/undo-redo-yum-install-on-centos-rhel\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of the most important and useful feature added to\u00a0YUM Package Manager\u00a0(from version\u00a03.2.25) is the \u2018yum history\u2019 command. It allows you to review a full history of yum transactions that have been run on a system. It shows the dates and times when a transactions were performed, whether the transactions succeeded or were aborted, the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/22\/how-to-undo-or-redo-a-yum-install-on-centos-and-rhel\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Undo or Redo a Yum Install on CentOS and RHEL&#8221;<\/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":[1],"tags":[],"class_list":["post-12141","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12141"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12141\/revisions"}],"predecessor-version":[{"id":12142,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12141\/revisions\/12142"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}