How To Fix Yum Duplicate Packages or Broken Dependencies

Fix Yum Duplicate Packages or Broken Dependencies

In this tutorial, we will show you how to fix yum duplicate packages or broken dependencies on the CentOS system. For those of you who didn’t know, Yum is a package management tool for installing, updating, and removing rpm packages on CentOS systems. When you try to install a package with yum command, you may encounter errors for various reasons.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step fix error duplicate packages or broken dependencies on the CentOS system.

Fix Yum Duplicate Packages or Broken Dependencies

Step 1. First, let’s start by ensuring your system is up-to-date.

sudo yum clean all
sudo yum update

Step 2. Install a package called ‘yum-utils‘ as root:

yum install yum-utils

Step 3. Then run the command:

yum-complete-transaction

yum-complete-transaction is a program which finds incomplete or aborted yum transactions on a system and attempts to complete them. It looks at the transaction-all* and transaction-done* files which can normally be found in /var/lib/yum if a yum transaction aborted in the middle of execution.

Several common commands I usually use:

package-cleanup –dupes # list out duplicates
package-cleanup –cleandupes # clean up duplicates
package-cleanup –problems # list out packages with broken dependencies

Now yum commands can be run without the unfinished transactions warning. I hope it will solve your problem also.

Congratulations! You have successfully fixed the yum error. Thanks for using this tutorial to fix yum duplicate packages or broken dependencies on CentOS. For additional help or useful information, we recommend you to check the official CentOS website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

Tags: