Fix yum duplicate packages

On a CentOS server, when running

It failed with following error

This is because previous “yum update” failed for some reason after package install. So no cleanup was done.

To fix, you need to use package-cleanup command.

To list all duplicate packages, run

To remove all duplicate packages, run

Now do a yum update

This will update your system and install any missing packages.

To verify if there any problem, run