Fixing Fedora distro-sync upgrade

It can happen to anyone. You went with yum distro-sync transaction that got interrupted and your system is broken. And you want to know how to fix it.

The most obvious step to try is to tell yum to finish what it started:

or try to roll-back with:

If that does not take you to the happy end or you suspect something is still wrong, keep on reading.

When you do a Fedora upgrade, yum wants to replace all your packages from the old version to the new one. And when you interrupt the transaction, your system ends in a mixed state having the packages from both version. The idea how to fix that is simple.

First you want yum to know the right $releasever. Know that even if newer fedora-release packages are installed and system show the right (desired) version when you run:

yum might still think you are on the old one. You need to delete any fedora-release packages that does not come from your disired Fedora version.

For instead imagine a broken update from f20 to f21:

As you can see you need to yum remove the old fedora-release packages. Once that is done, you don’t need to supply --releasever option to yum and yum should still correctly determine the version you are running.

And since it is more than likely that they are more duplicate packages like that, you want to remove them to:

If that fails you, install yum-utils first.

Afterwards you should be able to do yum distro-sync and yum update just fine.

But what about the kernel you ask? Chances are you still run the old one:

In my example we have 3 kernels installed and the latest kernel for f20 running. That is certainly not what we want.

If you need to tell grub to use different kernel, look at the approved answer by Jamie Nguyen on Ask Fedora. I am including the answer here for convenience:

Open /etc/default/grub and ensure this line exists:

Apply the change to grub.cfg by running:

List all possible menu entries:

Set the desired default menu entry:

Verify the default menu entry:

At this point most of the things should be in order and if you hit a problem with a broken package, just reinstall it.

Leave a comment

Your email address will not be published. Required fields are marked *