Top Banner

of 13

How to Rollback RPM's in Rhel5 and Rhel6 Linux

Oct 11, 2015

Download

Documents

Thai Viegas
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    Translate This Website

    4

    Search

    Home Blog Linux How to rollback RPM's in rhel5 and rhel6 linux search...

    Google Translation1.3

    691,137 hitsHomeFAQsBlogNews FeedsAdvanced SearchDisclaimerMathsContact UsWeb LinksUsername

    Password

    Remember me

    Login

    Password ReminderNo account yet? Createone

    Home

    How to rollback RPM's in rhel5 and rhel6 linuxUser Rating: / 17

    Poor Best Rate

    Written by KernelMount Author May 27, 2012 at 07:13 AM

    How to rollback RPM's in rhel5 and rhel6 linux?

    CentOS and RHEL5: RedHat EL version 5

    We can setup a RPM rollback using two simple steps on Centos 5 or RHEL5,

    Step 1)Create a file called macros

    [root@kernelmount ~]# cat /etc/rpm/macros%_repackage_all_erasures 1

    Step 2)Add tsflags=repackage line at end of yum configuration file, [root@kernelmount ~]# tail -1 /etc/yum.conf tsflags=repackage

    OK, Now your operating system is ready for rpm rollback

    Now update the latest patches via yum software repository,

    #yum update

    Check the rpm backup for reinstalling old packages

    search...

    Search

    RPM Fedora 3 RPM Package

    More

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    4

    We have 13 guestsonline

    Check the rpm backup for reinstalling old packages#ls -l /var/spool/repackage

    If you want to keep old rpms, you can manually install rpms from backup dir once you have removed the newly install rpmpackages,

    ROLL back RPM:

    If OS updated with in one hour period, use the following command#rpm -Uvh --rollback '1 hour ago'

    if yesterday #rpm -Uvh --rollback '1 day ago'

    if OS updated on a week ago,#rpm -Uvh --rollback '1 week ago'

    if OS updated on a month ago,#rpm -Uvh --rollback '1 month ago'

    if OS update on a year ago,#rpm -Uvh --rollback '1 Year Ago'

    if OS update on Mar 20th,#rpm -Uvh --rollback 'March 20'

    CentOS6 and RHEL6: RedHat Enterprises Linux 6

    RPM rollback in rhel6 version

    To check all the previous history of RPM installation/update:[root@kernelmount ~]# yum historyLoaded plugins: fastestmirror, refresh-packagekitID | Login user | Date and time | Action(s) | Altered-------------------------------------------------------------------------------47 | root | 2012-05-27 09:03 | Install | 4 46 | root | 2012-05-27 09:02 | Install | 2 45 | root | 2012-05-27 09:00 | I, O, U | 5 EE44 | root | 2012-04-24 03:47 | Install | 2 43 | root | 2012-04-23 09:13 | Install | 1 42 | root | 2012-04-17 18:29 | Install | 26 41 | root | 2012-04-17 18:25 | Install | 3 40 | root | 2012-04-16 05:52 | Install | 44 EE39 | root | 2012-04-16 05:50 | Install | 3 EE38 | System | 2012-04-15 23:45 | Install | 7 37 | System | 2012-04-15 23:43 | Install | 3 36 | root | 2012-04-15 17:32 | Install | 2 35 | root | 2012-04-15 17:09 | Install | 6 33 | root | 2012-04-15 16:43 | Install | 1

    OperatingSystems -Cheap

    nextag.com/Oper

    Save on OperatingSystems Software!Get Windows, Linux,Unix & More.

    EmailContinuity

    More

    Install Linux RPM Package Install RPM in Fedora RedHat Linux Yum

    Windows 7 64-bit OEM

    nextag.com/Wind

    Get MicrosoftWindows 7 64-bitOEM at CheapPrices. AmazingDeals!

    Top 7ComputerLaptops

    PanguDownload

    Top 10

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    StatisticsMembers: 47News: 147Web Links: 518Visitors: 691137

    32 | root | 2012-04-15 16:27 | Install | 3 > 31 | root | 2012-04-15 16:21 | Install | 45 30 | root | 2012-04-15 08:01 | Install | 5 29 | root | 2012-04-15 07:58 | Install | 3 28 | root | 2012-04-15 07:57 | Install | 12 history list

    To list the particular transaction:

    [root@kernelmount ~]# yum history list 46Loaded plugins: fastestmirror, refresh-packagekitID | Login user | Date and time | Action(s) | Altered-------------------------------------------------------------------------------46 | root | 2012-05-27 09:02 | Install | 2 history list

    To check the information of the transaction (details about rpm installation/deletion);

    [root@kernelmount ~]# yum history info 46Loaded plugins: fastestmirror, refresh-packagekitTransaction ID : 46Begin time : Sun May 27 09:02:42 2012Begin rpmdb : 1334:3890b02e5def56f3f7e637c38758d90e7591869dEnd time : 09:02:45 2012 (3 seconds)End rpmdb : 1336:1686e04e881838c5e7f0dd793219e70e05398325User : root Return-Code : SuccessTransaction performed with:Installed rpm-4.8.0-12.el6.i686Installed yum-3.2.27-14.el6.centos.noarchInstalled yum-plugin-fastestmirror-1.1.26-11.el6.noarchPackages Altered:Dep-Install file-devel-5.04-5.el6.i686Install rpm-devel-4.8.0-12.el6.i686history info[root@kernelmount ~]#

    [root@kernelmount ~]# yum history summary 46Loaded plugins: fastestmirror, refresh-packagekitLogin user | Time | Action(s) | Altered -------------------------------------------------------------------------------root | Last day | Install | 2history summary

    To repeat the same task which was performed in the 46th transaction ID:

    [root@kernelmount ~]# yum history repeat 46Loaded plugins: fastestmirror, refresh-packagekitLoading mirror speeds from cached hostfile* epel: ftp.tsukuba.wide.ad.jp* rpmfusion-free-updates: rpmfusion.famillecollet.com

    Top 10Laptops Deals

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    * rpmfusion-free-updates: rpmfusion.famillecollet.com* rpmfusion-free-updates-testing: rpmfusion.famillecollet.com* rpmfusion-nonfree-updates: rpmfusion.famillecollet.com* rpmfusion-nonfree-updates-testing: rpmfusion.famillecollet.comRepeating transaction 46, from Sun May 27 09:02:42 2012Dep-Install file-devel-5.04-5.el6.i686Install rpm-devel-4.8.0-12.el6.i686Package rpm-devel-4.8.0-12.el6.i686 already installed and latest versionhistory repeat

    To ROLLBACK All RPM'S in the particular transaction: ( To erase installed packages and To Install unintalledpackages)

    [root@kernelmount ~]# yum history undo 46Loaded plugins: fastestmirror, refresh-packagekitLoading mirror speeds from cached hostfileUndoing transaction 46, from Sun May 27 09:02:42 2012Dep-Install file-devel-5.04-5.el6.i686Install rpm-devel-4.8.0-12.el6.i686Resolving Dependencies--> Running transaction check---> Package file-devel.i686 0:5.04-5.el6 set to be erased---> Package rpm-devel.i686 0:4.8.0-12.el6 set to be erased--> Finished Dependency Resolution

    Dependencies Resolved

    =============================================Package Arch Version Repository Size=============================================Removing:file-devel i686 5.04-5.el6 @centos6 6.5 krpm-devel i686 4.8.0-12.el6 @centos6 270k

    Transaction Summary============================================Remove 2 Package(s)Reinstall 0 Package(s)Downgrade 0 Package(s)

    Is this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionErasing : rpm-devel-4.8.0-12.el6.i686 1/2 Erasing : file-devel-5.04-5.el6.i686 2/2

    Removed:file-devel.i686 0:5.04-5.el6 rpm-devel.i686 0:4.8.0-12.el6

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    file-devel.i686 0:5.04-5.el6 rpm-devel.i686 0:4.8.0-12.el6

    Complete![root@kernelmount ~]#

    To reinstall the rpm's which are erased via undo option:

    [root@kernelmount ~]# yum history redo 46Loaded plugins: fastestmirror, refresh-packagekitLoading mirror speeds from cached hostfileRepeating transaction 46, from Sun May 27 09:02:42 2012Dep-Install file-devel-5.04-5.el6.i686Install rpm-devel-4.8.0-12.el6.i686Resolving Dependencies--> Running transaction check---> Package rpm-devel.i686 0:4.8.0-12.el6 set to be updated--> Processing Dependency: file-devel(x86-32) for package: rpm-devel-4.8.0-12.el6.i686--> Running transaction check---> Package file-devel.i686 0:5.04-5.el6 set to be updated--> Finished Dependency Resolution

    Dependencies Resolved

    =============================================Package Arch Version Repository Size=============================================Installing:rpm-devel i686 4.8.0-12.el6 centos6 88 kInstalling for dependencies:file-devel i686 5.04-5.el6 centos6 23 k

    Transaction Summary==============================================Install 2 Package(s)Upgrade 0 Package(s)

    Total download size: 111 kInstalled size: 276 kIs this ok [y/N]: yDownloading Packages:(1/2): file-devel-5.04-5.el6.i686.rpm | 23 kB 00:00 (2/2): rpm-devel-4.8.0-12.el6.i686.rpm | 88 kB 00:00 ------------------------------------------------------------------------------------------Total 1.6 MB/s | 111 kB 00:00 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    Running TransactionInstalling : file-devel-5.04-5.el6.i686 1/2 Installing : rpm-devel-4.8.0-12.el6.i686 2/2

    Installed:rpm-devel.i686 0:4.8.0-12.el6

    Dependency Installed:file-devel.i686 0:5.04-5.el6

    Complete!You have new mail in /var/spool/mail/root[root@kernelmount ~]#

    Yum database location:

    [root@kernelmount ~]# ls -ltr /var/lib/yum/yumdb/total 248drwxr-xr-x. 5 root root 4096 Apr 8 17:21 Cdrwxr-xr-x. 9 root root 4096 Apr 8 18:43 vdrwxr-xr-x. 5 root root 4096 Apr 15 05:23 Odrwxr-xr-x. 57 root root 12288 Apr 15 23:46 adrwxr-xr-x. 33 root root 4096 Apr 16 05:50 idrwxr-xr-x. 58 root root 12288 Apr 17 18:25 sdrwxr-xr-x. 24 root root 4096 Apr 24 03:47 tdrwxr-xr-x. 41 root root 4096 May 27 09:30 rdrwxr-xr-x. 254 root root 36864 May 27 09:35 ldrwxr-xr-x 17 root root 4096 May 27 09:35 S

    Yum history command is using the sqlite database file for retrieving rpm installation/update informations

    [root@kernelmount ~]# ls -ltr /var/lib/yum/history/total 304-rw-------. 1 root root 278528 May 27 09:30 history-2012-04-08.sqlite-rw------- 1 root root 11264 May 27 09:31 history-2012-05-27.sqlite.old-rw------- 1 root root 14336 May 27 09:35 history-2012-05-27.sqlite

    Another Example:

    Rollback the LAST OS UPDATE:

    Running OS update via yum:

    [root@kernelmount ~]# yum update --skip-brokenLoaded plugins: fastestmirror, refresh-packagekitLoading mirror speeds from cached hostfileSetting up Update ProcessResolving Dependencies--> Running transaction check---> Package libavcodec52.i686 0:0.7.11-52.el6 set to be updated

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    ---> Package libavcodec52.i686 0:0.7.11-52.el6 set to be updated--> Processing Dependency: libxavs.so.1 for package: libavcodec52-0.7.11-52.el6.i686--> Processing Dependency: libvpx.so.1 for package: libavcodec52-0.7.11-52.el6.i686--> Processing Dependency: libva.so.1 for package: libavcodec52-0.7.11-52.el6.i686---> Package x264.i686 0:0.120-4.20120303.el6_bootstrap set to be updated--> Processing Dependency: x264-libs = 0.120-4.20120303.el6_bootstrap for package: x264-0.120-4.20120303.el6_bootstrap.i686--> Processing Dependency: libx264.so.120 for package: x264-0.120-4.20120303.el6_bootstrap.i686--> Running transaction check---> Package libavcodec52.i686 0:0.7.11-52.el6 set to be updated--> Processing Dependency: libvpx.so.1 for package: libavcodec52-0.7.11-52.el6.i686---> Package libva1.i686 0:1.0.15-7.el6 set to be updated---> Package libxavs1.i686 0:0.1.51-2.el6 set to be updated---> Package x264-libs.i686 0:0.120-4.20120303.el6_bootstrap set to be updated--> Finished Dependency Resolution--> Running transaction check---> Package x264.i686 0:0.120-4.20120303.el6_bootstrap set to be updated---> Package x264-libs.i686 0:0.120-4.20120303.el6_bootstrap set to be updated--> Finished Dependency Resolution--> Running transaction check---> Package x264.i686 0:0.120-4.20120303.el6_bootstrap set to be updated---> Package x264-libs.i686 0:0.120-4.20120303.el6_bootstrap set to be updated--> Finished Dependency Resolution

    Packages skipped because of dependency problems:libavcodec52-0.7.11-52.el6.i686 from atrpmslibva1-1.0.15-7.el6.i686 from atrpmslibxavs1-0.1.51-2.el6.i686 from atrpms

    Dependencies Resolved

    ==============================================Package Arch Version Repository Size==============================================Updating:x264 i686 0.120-4.20120303.el6_bootstrap rpmfusion-free-updates-testing 61 kInstalling for dependencies:x264-libs i686 0.120-4.20120303.el6_bootstrap rpmfusion-free-updates-testing 575 kSkipped (dependency problems):libavcodec52 i686 0.7.11-52.el6 atrpms 2.3Mlibva1 i686 1.0.15-7.el6 atrpms 31 klibxavs1 i686 0.1.51-2.el6 atrpms 129 k

    Transaction Summary=============================================Install 1 Package(s)Upgrade 1 Package(s)

    Total download size: 635 k

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    Total download size: 635 kIs this ok [y/N]: yDownloading Packages:(1/2): x264-0.120-4.20120303.el6_bootstrap.i686.rpm | 61kB 00:00 (2/2): x264-libs-0.120-4.20120303.el6_bootstrap.i686.rpm | 575kB 00:02 -------------------------------------------------------------------------------------------------------Total 157 kB/s | 635 kB 00:04 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionInstalling : x264-libs-0.120-4.20120303.el6_bootstrap.i686 1/3 /sbin/ldconfig: /lib/libsamplerate.so.0 is not a symbolic link

    Updating : x264-0.120-4.20120303.el6_bootstrap.i686 2/3 Cleanup : x264-0.118-17_20111111.2245.el6.i686 3/3

    Dependency Installed:x264-libs.i686 0:0.120-4.20120303.el6_bootstrap

    Updated:x264.i686 0:0.120-4.20120303.el6_bootstrap

    Skipped (dependency problems):libavcodec52.i686 0:0.7.11-52.el6 libva1.i686 0:1.0.15-7.el6 libxavs1.i686 0:0.1.51-2.el6

    Complete!

    OS update succssfully completed in the transaction id 3 :

    [root@kernelmount ~]# yum historyLoaded plugins: fastestmirror, refresh-packagekitID | Login user | Date and time | Action(s) | Altered-------------------------------------------------------------------------------3 | root | 2012-06-03 17:00 | I, U | 2 EE2 | root | 2012-05-28 05:01 | Install | 2 EE1 | root | 2012-05-27 09:34 | Install | 16 EEhistory list

    Transaction Information :

    [root@kernelmount ~]# yum history info 3Loaded plugins: fastestmirror, refresh-packagekitTransaction ID : 3Begin time : Sun Jun 3 17:00:46 2012

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    Begin time : Sun Jun 3 17:00:46 2012Begin rpmdb : 1357:599ba4c925585f029a96a9931ab89c269e7becf6End time : 17:01:10 2012 (24 seconds)End rpmdb : 1358:afbc5d63e2ced3121710e2d30e20a515bce861daUser : root Return-Code : SuccessTransaction performed with:Installed rpm-4.8.0-12.el6.i686Installed yum-3.2.27-14.el6.centos.noarchInstalled yum-plugin-fastestmirror-1.1.26-11.el6.noarchPackages Altered:Updated x264-0.118-17_20111111.2245.el6.i686Update 0.120-4.20120303.el6_bootstrap.i686Dep-Install x264-libs-0.120-4.20120303.el6_bootstrap.i686Scriptlet output:1 /sbin/ldconfig: /lib/libsamplerate.so.0 is not a symbolic link2 3 history info

    To ROLLBACK everything in last OS update (use undo option):

    [root@kernelmount ~]# yum history undo 3Loaded plugins: fastestmirror, refresh-packagekitLoading mirror speeds from cached hostfileUndoing transaction 3, from Sun Jun 3 17:00:46 2012Updated x264-0.118-17_20111111.2245.el6.i686Update 0.120-4.20120303.el6_bootstrap.i686Dep-Install x264-libs-0.120-4.20120303.el6_bootstrap.i686Resolving Dependencies--> Running transaction check---> Package x264.i686 0:0.118-17_20111111.2245.el6 set to be updated---> Package x264.i686 0:0.120-4.20120303.el6_bootstrap set to be erased---> Package x264-libs.i686 0:0.120-4.20120303.el6_bootstrap set to be erased--> Finished Dependency Resolution

    Dependencies Resolved

    ================================================Package Arch Version Repository Size================================================Removing:x264-libs i686 0.120-4.20120303.el6_bootstrap @rpmfusion-free-updates-testing 1.3 MDowngrading:x264 i686 0.118-17_20111111.2245.el6 atrpms 370 k

    Transaction Summary================================================Remove 1 Package(s)Reinstall 0 Package(s)

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    Reinstall 0 Package(s)Downgrade 1 Package(s)

    Total download size: 370 kIs this ok [y/N]: yDownloading Packages:x264-0.118-17_20111111.2245.el6.i686.rpm | 370 kB 00:03 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionInstalling : x264-0.118-17_20111111.2245.el6.i686 1/3 Cleanup : x264-0.120-4.20120303.el6_bootstrap.i686 2/3 Erasing : x264-libs-0.120-4.20120303.el6_bootstrap.i686 3/3

    Removed:x264.i686 0:0.120-4.20120303.el6_bootstrap x264-libs.i686 0:0.120-4.20120303.el6_bootstrap

    Installed:x264.i686 0:0.118-17_20111111.2245.el6

    Complete![root@kernelmount ~]#

    That's all

    Thanks for your time

    Regards,KM Author

    User Comments

    Please login or register to add comments

    Last Updated ( Oct 06, 2012 at 06:11 AM )

    Back

    Latest News

    How to control and view disks devices information in linux? udisks

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    Dstat - A tool for generating system resources statisticsHow to list block devices in linux?How to list content of initramfs image in linux?TechnologyHow to freeze a filesystem in linux?How to view UUID value and print block device attributes in linux?TRB PG Teachers Recruitment 2011 2012 Mathematics Booklet series AHow to rollback RPM's in rhel5 and rhel6 linuxDisplay error report in aixHow to collect full system information in aix?Install rpm in linuxHow to view process tree in linux? pstreezip utility in linuxHow to archive files in linux?How to generate report for audit daemon logs in linux? system auditHow to view WWN (World Wide Node/Port Name) of HBA card in linux and solaris?How to sort the ip addreses by class? ipsortHow to view detailed hardware information in linux? dmidecodeHow to list all pci and usb devices in linux?How to view cpu information in linux?How to view system device information by bus, class, and topology?List all interrupt requests (IRQ) in linuxList all SCSI devices and their attributes in linuxHow to list all lock files in linux?How to view bios information in linux? biosdecodeHow to view total ipcounts in the network range?How to view netmask values for particular network range? CIDR IPCALC IPTABEngineering Mathematics I Question BankRAID6 configuration in linuxWhat is the difference between Telnet and SSH?RAID 0+1 configuration in linux RHEL5RAID 1+0 configuration in linux RHEL5How to check the ipaddress status - Alive or Offline?How to view ethernet statistics in linux?How to check spelling mistakes and replace the correct word in my file?How to print 10 odd and even numbers using linux command?How to securely remove files in linux or unix?Capturing remote login sessions via port in linuxHow to archive a directory in linux? tar,gtar,gzip,bzip2 and zipset user access limitation in linuxHow to save my session logs in linux?

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    How to take full system report in linux?chattr set attribute to fileEthernet bonding configuration in linuxHow to view inode disk usage and inode statistics in linux?How to view dump filesystem information in linux?Sendmail installation and configuration in linuxSample Sudo configuration fileCentralized syslog server configuration in linuxAcl command setup and execution in linuxOperating System Latest NewsLatest News in Cloud ComputingLinux System Administrator jobUbuntu mirrors for latest updatesText based web browser in linux? - w3mHow to view memory map or utilization of process?How to view list of opened files, devices, sockets and share objects libraries in linux?TN Board Results - Links for +2 Exam Results - TamilnaduHow to view system and processor in solaris?How to trace system call in linux rhel5?How to trace a library call when running commands in linux rhel5?How to set quota to users and groups in linux rhel5?How to find two thread memory error and memory leaks? - valgrindLshw installation and configuration linuxHow to increase swap space in linux?How to increase semaphore value in linux?Aide installation and configuration in linuxPrtdiag Opensource tool - To View hardware information in solarisSamba server installation and configuration in linuxPQT - Question BankHow to mount iso image in linux ?LDAP configuration, installation in RHEL5 linuxRAID 0,1 and 5 Configuration in RHEL5LVM Logical Volume management in RHEL5Configuring yum in RHEL5 operating systemDNS Configuration in linux rhel5Aix backup and archive commandsAix terminal, Networks and NFS commandsAix basic commandsHow to create iso image in linux for our own data?Opensource rsnapshot installation and configuration in linuxLinux Kernel Version table and release history

  • pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    4

    Find new directories in the home directoryHow to forward IP packets to remote computers using IP tables?Welcome to KernelMount Website !

    : Home :: FAQs :: Blog :: News Feeds :: Advanced Search :: Contact Us :: Disclaimer :: Mamblog :: Maths :: Contact Us :: Web Links :KernelMount@ 2009-2013 Some Rights Reserved ;)

    More

    Linux Kernel RPM Install File RPM RPM Package RPM Repository