You are on page 1of 13

pdfcrowd.com open 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 Translation
1.3
691,137 hits
Home
FAQs
Blog
News Feeds
Advanced Search
Disclaimer
Maths
Contact Us
Web Links
Username

Password

Remember me
Login
Password Reminder
No account yet? Create
one
Home
How to rollback RPM's in rhel5 and rhel6 linux
User 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.com open in browser PRO version Are you a developer? Try out the HTML to PDF API
4
We have 13 guests
online
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 rpm
packages,
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 history
Loaded plugins: fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
47 | root <root> | 2012-05-27 09:03 | Install | 4
46 | root <root> | 2012-05-27 09:02 | Install | 2
45 | root <root> | 2012-05-27 09:00 | I, O, U | 5 EE
44 | root <root> | 2012-04-24 03:47 | Install | 2
43 | root <root> | 2012-04-23 09:13 | Install | 1
42 | root <root> | 2012-04-17 18:29 | Install | 26
41 | root <root> | 2012-04-17 18:25 | Install | 3
40 | root <root> | 2012-04-16 05:52 | Install | 44 EE
39 | root <root> | 2012-04-16 05:50 | Install | 3 EE
38 | System <unset> | 2012-04-15 23:45 | Install | 7
37 | System <unset> | 2012-04-15 23:43 | Install | 3
36 | root <root> | 2012-04-15 17:32 | Install | 2
35 | root <root> | 2012-04-15 17:09 | Install | 6 <
34 | root <root> | 2012-04-15 16:59 | Install | 1 >
33 | root <root> | 2012-04-15 16:43 | Install | 1 <
32 | root <root> | 2012-04-15 16:27 | Install | 3 >
Operating
Systems -
Cheap
nextag.com/Oper
Save on Operating
Systems Software!
Get Windows, Linux,
Unix & More.
Email
Continuity
More
Install Linux RPM Package
Install RPM in Fedora
RedHat Linux Yum
Windows 7 64-
bit OEM
nextag.com/Wind
Get Microsoft
Windows 7 64-bit
OEM at Cheap
Prices. Amazing
Deals!
Top 7
Computer
Laptops
Pangu
Download
Top 10
pdfcrowd.com open in browser PRO version Are you a developer? Try out the HTML to PDF API
Statistics
Members: 47
News: 147
Web Links: 518
Visitors: 691137
32 | root <root> | 2012-04-15 16:27 | Install | 3 >
31 | root <root> | 2012-04-15 16:21 | Install | 45
30 | root <root> | 2012-04-15 08:01 | Install | 5
29 | root <root> | 2012-04-15 07:58 | Install | 3
28 | root <root> | 2012-04-15 07:57 | Install | 12
history list
To list the particular transaction:
[root@kernelmount ~]# yum history list 46
Loaded plugins: fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
46 | root <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 46
Loaded plugins: fastestmirror, refresh-packagekit
Transaction ID : 46
Begin time : Sun May 27 09:02:42 2012
Begin rpmdb : 1334:3890b02e5def56f3f7e637c38758d90e7591869d
End time : 09:02:45 2012 (3 seconds)
End rpmdb : 1336:1686e04e881838c5e7f0dd793219e70e05398325
User : root <root>
Return-Code : Success
Transaction performed with:
Installed rpm-4.8.0-12.el6.i686
Installed yum-3.2.27-14.el6.centos.noarch
Installed yum-plugin-fastestmirror-1.1.26-11.el6.noarch
Packages Altered:
Dep-Install file-devel-5.04-5.el6.i686
Install rpm-devel-4.8.0-12.el6.i686
history info
[root@kernelmount ~]#
[root@kernelmount ~]# yum history summary 46
Loaded plugins: fastestmirror, refresh-packagekit
Login user | Time | Action(s) | Altered
-------------------------------------------------------------------------------
root <root> | Last day | Install | 2
history summary
To repeat the same task which was performed in the 46th transaction ID:
[root@kernelmount ~]# yum history repeat 46
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* epel: ftp.tsukuba.wide.ad.jp
* rpmfusion-free-updates: rpmfusion.famillecollet.com
Top 10
Laptops Deals
pdfcrowd.com open 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.com
Repeating transaction 46, from Sun May 27 09:02:42 2012
Dep-Install file-devel-5.04-5.el6.i686
Install rpm-devel-4.8.0-12.el6.i686
Package rpm-devel-4.8.0-12.el6.i686 already installed and latest version
history repeat
To ROLLBACK All RPM'S in the particular transaction: ( To erase installed packages and To Install unintalled
packages)
[root@kernelmount ~]# yum history undo 46
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Undoing transaction 46, from Sun May 27 09:02:42 2012
Dep-Install file-devel-5.04-5.el6.i686
Install rpm-devel-4.8.0-12.el6.i686
Resolving 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 k
rpm-devel i686 4.8.0-12.el6 @centos6 270
k
Transaction Summary
============================================
Remove 2 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : 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.com open 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 46
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Repeating transaction 46, from Sun May 27 09:02:42 2012
Dep-Install file-devel-5.04-5.el6.i686
Install rpm-devel-4.8.0-12.el6.i686
Resolving 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 k
Installing 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 k
Installed size: 276 k
Is this ok [y/N]: y
Downloading 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_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
pdfcrowd.com open in browser PRO version Are you a developer? Try out the HTML to PDF API
Running Transaction
Installing : 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 248
drwxr-xr-x. 5 root root 4096 Apr 8 17:21 C
drwxr-xr-x. 9 root root 4096 Apr 8 18:43 v
drwxr-xr-x. 5 root root 4096 Apr 15 05:23 O
drwxr-xr-x. 57 root root 12288 Apr 15 23:46 a
drwxr-xr-x. 33 root root 4096 Apr 16 05:50 i
drwxr-xr-x. 58 root root 12288 Apr 17 18:25 s
drwxr-xr-x. 24 root root 4096 Apr 24 03:47 t
drwxr-xr-x. 41 root root 4096 May 27 09:30 r
drwxr-xr-x. 254 root root 36864 May 27 09:35 l
drwxr-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-broken
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package libavcodec52.i686 0:0.7.11-52.el6 set to be updated
pdfcrowd.com open 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 atrpms
libva1-1.0.15-7.el6.i686 from atrpms
libxavs1-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 k
Installing for dependencies:
x264-libs i686 0.120-4.20120303.el6_bootstrap rpmfusion-free-updates-
testing 575 k
Skipped (dependency problems):
libavcodec52 i686 0.7.11-52.el6 atrpms 2.3
M
libva1 i686 1.0.15-7.el6 atrpms 31 k
libxavs1 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.com open in browser PRO version Are you a developer? Try out the HTML to PDF API
Total download size: 635 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): x264-0.120-4.20120303.el6_bootstrap.i686.rpm | 61
kB 00:00
(2/2): x264-libs-0.120-4.20120303.el6_bootstrap.i686.rpm | 575
kB 00:02
-------------------------------------------------------------------------------------------------------
Total 157 kB/s | 635 kB 00:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 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 history
Loaded plugins: fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
3 | root <root> | 2012-06-03 17:00 | I, U | 2 EE
2 | root <root> | 2012-05-28 05:01 | Install | 2 EE
1 | root <root> | 2012-05-27 09:34 | Install | 16 EE
history list
Transaction Information :
[root@kernelmount ~]# yum history info 3
Loaded plugins: fastestmirror, refresh-packagekit
Transaction ID : 3
Begin time : Sun Jun 3 17:00:46 2012
pdfcrowd.com open in browser PRO version Are you a developer? Try out the HTML to PDF API
Begin time : Sun Jun 3 17:00:46 2012
Begin rpmdb : 1357:599ba4c925585f029a96a9931ab89c269e7becf6
End time : 17:01:10 2012 (24 seconds)
End rpmdb : 1358:afbc5d63e2ced3121710e2d30e20a515bce861da
User : root <root>
Return-Code : Success
Transaction performed with:
Installed rpm-4.8.0-12.el6.i686
Installed yum-3.2.27-14.el6.centos.noarch
Installed yum-plugin-fastestmirror-1.1.26-11.el6.noarch
Packages Altered:
Updated x264-0.118-17_20111111.2245.el6.i686
Update 0.120-4.20120303.el6_bootstrap.i686
Dep-Install x264-libs-0.120-4.20120303.el6_bootstrap.i686
Scriptlet output:
1 /sbin/ldconfig: /lib/libsamplerate.so.0 is not a symbolic link
2
3
history info
To ROLLBACK everything in last OS update (use undo option):
[root@kernelmount ~]# yum history undo 3
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Undoing transaction 3, from Sun Jun 3 17:00:46 2012
Updated x264-0.118-17_20111111.2245.el6.i686
Update 0.120-4.20120303.el6_bootstrap.i686
Dep-Install x264-libs-0.120-4.20120303.el6_bootstrap.i686
Resolving 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 M
Downgrading:
x264 i686 0.118-17_20111111.2245.el6 atrpms
370 k
Transaction Summary
================================================
Remove 1 Package(s)
Reinstall 0 Package(s)
pdfcrowd.com open 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 k
Is this ok [y/N]: y
Downloading Packages:
x264-0.118-17_20111111.2245.el6.i686.rpm | 370 kB
00:03
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 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 )
<Previous Next>
Back
Latest News
How to control and view disks devices information in linux? udisks
pdfcrowd.com open in browser PRO version Are you a developer? Try out the HTML to PDF API
Dstat - A tool for generating system resources statistics
How to list block devices in linux?
How to list content of initramfs image in linux?
Technology
How 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 A
How to rollback RPM's in rhel5 and rhel6 linux
Display error report in aix
How to collect full system information in aix?
Install rpm in linux
How to view process tree in linux? pstree
zip utility in linux
How to archive files in linux?
How to generate report for audit daemon logs in linux? system audit
How to view WWN (World Wide Node/Port Name) of HBA card in linux and solaris?
How to sort the ip addreses by class? ipsort
How to view detailed hardware information in linux? dmidecode
How 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 linux
List all SCSI devices and their attributes in linux
How to list all lock files in linux?
How to view bios information in linux? biosdecode
How to view total ipcounts in the network range?
How to view netmask values for particular network range? CIDR IPCALC IPTAB
Engineering Mathematics I Question Bank
RAID6 configuration in linux
What is the difference between Telnet and SSH?
RAID 0+1 configuration in linux RHEL5
RAID 1+0 configuration in linux RHEL5
How 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 linux
How to archive a directory in linux? tar,gtar,gzip,bzip2 and zip
set user access limitation in linux
How to save my session logs in linux?
pdfcrowd.com open 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 file
Ethernet bonding configuration in linux
How to view inode disk usage and inode statistics in linux?
How to view dump filesystem information in linux?
Sendmail installation and configuration in linux
Sample Sudo configuration file
Centralized syslog server configuration in linux
Acl command setup and execution in linux
Operating System Latest News
Latest News in Cloud Computing
Linux System Administrator job
Ubuntu mirrors for latest updates
Text based web browser in linux? - w3m
How 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 - Tamilnadu
How 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? - valgrind
Lshw installation and configuration linux
How to increase swap space in linux?
How to increase semaphore value in linux?
Aide installation and configuration in linux
Prtdiag Opensource tool - To View hardware information in solaris
Samba server installation and configuration in linux
PQT - Question Bank
How to mount iso image in linux ?
LDAP configuration, installation in RHEL5 linux
RAID 0,1 and 5 Configuration in RHEL5
LVM Logical Volume management in RHEL5
Configuring yum in RHEL5 operating system
DNS Configuration in linux rhel5
Aix backup and archive commands
Aix terminal, Networks and NFS commands
Aix basic commands
How to create iso image in linux for our own data?
Opensource rsnapshot installation and configuration in linux
Linux Kernel Version table and release history
pdfcrowd.com open in browser PRO version Are you a developer? Try out the HTML to PDF API
4
Find new directories in the home directory
How 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