Monday, June 23, 2014

Recover from failed update in CentOS/RHEL 6

NOTE: It's good idea to tee the output of all of these commands, in case you need to go back and fix something.
If a major update gets interrupted, it can leave the RPM database in a pretty upgly state.

First try to complete the update:
  yum-complete-transaction
 
If this fails, start by removing all the duplicate packages:
  package-clean --cleandupes

If that command exits with an error, manually fix any problems, by updating individual packages, etc. Then re-run. Make sure to watch the output. In particular, write down any config files moved to *.rpmsave, so you can move then back when it's done.

Restore any rpmsave files that need to be.

Now try running:
  yum-complete-transaction --skip-broken
 
There's a good chance this will fail, with a message that the transaction has been disabled.

So re-run the update now:
  yum update

Reinstall the desktop, in case package-clean removed essential packages:
yum groupinstall "Base"
yum groupinstall "Desktop"
yum groupinstall "Desktop Platform"
yum groupinstall "General Purpose Desktop"

Other things you may want to reinstall:
yum install openssh-server
yum groupinstall "Directory Client" (Remember to start sssd)
yum groupinstall "Network file system client"
yum groupinstall "NFS file server"
yum groupinstall "Development Tools"
Anything else important to you. Hopefully you kept a list after setting up the system.

Reboot the system

Reinstall proprietary drivers, as needed.

Hopefully, everything works now. Please comment, if you know of other things that should be done after re-running the update.