I’ve had a power cut recently, which seems to have corrupted the latest Kernel I have installed on my CentOS 6 server. I can boot into the previous one just fine, but of course if I forget to make a choice on startup, the server doesn’t start up. That’s annoying.
Thankfully there are ways to either fix the latest version, remove it, and even exclude a particular version from future updates. Here’s what worked for me on CentOS 6:
Every so often, a yum update brings unexpected results with it, like services no longer working due to spurious error messages that don’t tell you what’s actually wrong. This only very rarely happens though, and we may need to revert to the state of our system before such an update took place.
Thankfully, yum has a nice feature that helps us do this, namely yum history.
The command will bring up the latest 20 transactions by default, be those installs, updates or removals. There’s a transaction ID at the very front of each line, with which we can tell yum to undo said transaction. In my case, transaction 86 didn’t work out so well, so let’s undo whatever has happened there (in my case, a combination of installs, updates and overwrites).
Let’s revert those changes with yum history undo 86
The familiar text output comes up, eventually showing a list of packages that will be affected. Confirm those changes with y and let yum do it’s job.
After a few moments, our system has been restored to a state from before the update occurred, hopefully back into a running state.
There’s another interesting option called yum history rollback (ID). This will let us go back more than one step in our list, restoring the changes made by multiple transactions. Vivke’s article has more information on this.
I’m working on a handful of servers that all have the same problem: when running yum, an error message appears that tells me a package called ntpupdate needs to be upgraded, but somehow this doesn’t work and the package is being skipped. Then follows a huge list of duplicate packages that are installed on those systems (probably installed by the automatic package updater within Plesk).
From time to time, the yum package manager may encounter issues with duplicate packages that are erroneously installed on a system. This manifests in a yum update going awry, telling us something along the lines of this:
I’ve just tried to update one of my CentOS 6.2 servers that was built from an older AMI, only to find that the yum update command stopped unexpectedly with several dependency errors. They all pointed to something called “qpid”, and I must admit that I’ve never heard of it – nor did I know that it was installed.
The long list ended with the following suggestion:
Youcould try using--skip-broken to work around the problem
Youcould tryrunning: rpm-Va--nofiles--nodigest
And why not indeed, since yum is so nice to give us suggestions. I’ve tired running “yum update –skip-broken” and got the following message:
Every once in a while it can happen happen that use use “yum update” to update your Linux system.
Usually this works without a hitch, but you may have come across a message such as this:
Setting up Install Process
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
But what does this mean, and how do we alleviate this?