Cross Yum repository dependency conflicts

I know it’s happened to me:

I have a repository enabled for some reason, and yum pulls a package in. Some time in the future I then end up disabling the repository. Now a potential problem has cropped up. Yum won’t update the packages properly, because the release is different. So the troubling thing is if you want to update, you’ll need to either remove the package and install it from the proper repository, download the RPM and install with rpm (which means you’ll likely have to let it over write packages and files included – not so nice even if doable) or somehow make Yum update it. The problem is, if you just uninstall/erase the package you may actually have to uninstall dependencies you’d rather not remove (say, from an enabled repository). This is not always the case but it is a potential outcome at times.

I had this problem just now. On a whim I thought of and tried something. The key is: downgrade.

If you have package A from repository A that will be removed if you remove package B from repository B then all you need to do is (obviously make sure that package B is in one of your enabled repositories) :

yum downgrade [package(s)]

Obviously replace [package(s)] with the packages you want to install in the enabled repository.

Of course, make sure everything goes okay; although yum is fairly nice, it’s still only a program that can’t make decisions or know the internal workings of other programs, your system or anything unrelated to it or its database. But after this you can get updates (and that’s a good thing).