Difference between revisions of "Rollback"

From Atomicorp Wiki
Jump to: navigation, search
m (Yum Rollbacks)
m (Yum Rollbacks)
 
(One intermediate revision by one user not shown)
Line 44: Line 44:
  
 
= Yum Rollbacks =
 
= Yum Rollbacks =
 +
 +
Yum has a command "downgrade" that can be used to downgrade or rollback and installation or upgrade.  "downgrade" is very easy to use if the package does not have any dependencies which effect the downgrade. 
  
 
To rollback a single package, use this command:
 
To rollback a single package, use this command:
Line 55: Line 57:
 
   yum downgrade foo
 
   yum downgrade foo
 
   
 
   
Setting up Downgrade Process
+
  Setting up Downgrade Process
Resolving Dependencies
+
  Resolving Dependencies
--> Running transaction check
+
  --> Running transaction check
---> Package foo.i686 0:1.1.11-1.fc13 set to be downgraded
+
  ---> Package foo.i686 0:1.1.11-1.fc13 set to be downgraded
---> Package foo.i686 0:1.1.11-1.fc14 set to be erased
+
  ---> Package foo.i686 0:1.1.11-1.fc14 set to be erased
Error: Package: foo-devel-3.6.23-1.fc14.i686 (@rawhide/12)
+
  Error: Package: foo-devel-3.6.23-1.fc14.i686 (@rawhide/12)
Requires: foo = 1.1.11-1.fc14
+
  Requires: foo = 1.1.11-1.fc14
Removing: foo-1.1.11-1.fc14.i686 (@rawhide/12)
+
  Removing: foo-1.1.11-1.fc14.i686 (@rawhide/12)
foo = 1.1.11-1.fc14
+
  foo = 1.1.11-1.fc14
Downgraded By: foo-1.1.11-1.fc13.i686 (fedora)
+
  Downgraded By: foo-1.1.11-1.fc13.i686 (fedora)
foo = 1.1.11-1.fc13
+
  foo = 1.1.11-1.fc13
You could try using --skip-broken to work around the problem
+
  You could try using --skip-broken to work around the problem
  
 
The "foo" package depends on foo-devel package, so both foo-devel and foo have to be downgraded:
 
The "foo" package depends on foo-devel package, so both foo-devel and foo have to be downgraded:
  
 
   yum downgrade foo foo-devel
 
   yum downgrade foo foo-devel

Latest revision as of 14:35, 19 March 2011

Contents

[edit] RPM rollbacks

[edit] Configuring the System to save rollback information

1. Configure yum to save rollback information.

Add the line

tsflags=repackage*

to /etc/yum.conf.

2. Configure command-line rpm to save rollback information:

Add the line:

%_repackage_all_erasures 1

to /etc/rpm/macros.

[edit] Using rollbacks

Back out an updates, which you can do with either rollback, or oldpackages

Method 1:

To rollback to a previous state, perform an rpm update with the --rollback option followed by a date/time specifier.

Examples:

rpm -Uhv --rollback '9:00 am'

rpm -Uhv --rollback '4 hours ago'

rpm -Uhv --rollback 'december 25'.

Method 2:

Use the "oldpackage" option to manually force a specific RPM:

rpm -Uvh --oldpackage foo-1-1.i386.rpm

Keep in mind this will only let you rollback what can be rolled back. Some OS updates are not reversible, for example, if you did an upgrade of mysql that changed your tables you would not be able to roll back this way.

[edit] Yum Rollbacks

Yum has a command "downgrade" that can be used to downgrade or rollback and installation or upgrade. "downgrade" is very easy to use if the package does not have any dependencies which effect the downgrade.

To rollback a single package, use this command:


 yum downgrade package

"yum downgrade" does not resolve dependencies automatically, which means if you have dependencies, you will have to do this manually. Example:


 yum downgrade foo

 Setting up Downgrade Process
 Resolving Dependencies
 --> Running transaction check
 ---> Package foo.i686 0:1.1.11-1.fc13 set to be downgraded
 ---> Package foo.i686 0:1.1.11-1.fc14 set to be erased
 Error: Package: foo-devel-3.6.23-1.fc14.i686 (@rawhide/12)
 Requires: foo = 1.1.11-1.fc14
 Removing: foo-1.1.11-1.fc14.i686 (@rawhide/12)
 foo = 1.1.11-1.fc14
 Downgraded By: foo-1.1.11-1.fc13.i686 (fedora)
 foo = 1.1.11-1.fc13
 You could try using --skip-broken to work around the problem

The "foo" package depends on foo-devel package, so both foo-devel and foo have to be downgraded:

 yum downgrade foo foo-devel
Personal tools