Tag: package-cleanup

  • Fix yum duplicate packages

    On a CentOS server, when running

    yum update
    

    It failed with following error

    acl-2.2.51-14.el7.x86_64 is a duplicate with acl-2.2.51-12.el7.x86_64
    alt-libcurlssl-7.60.0-1.el7.x86_64 is a duplicate with alt-libcurlssl-7.54.0-8.el7.cloudlinux.x86_64
    alt-php-config-1-29.1.el7.noarch is a duplicate with alt-php-config-1-27.el7.noarch
    alt-php44-4.4.9-88.el7.x86_64 is a duplicate with alt-php44-4.4.9-81.el7.x86_64
    alt-php44-bcmath-4.4.9-88.el7.x86_64 is a duplicate with alt-php44-bcmath-4.4.9-81.el7.x86_64
    

    https://gist.github.com/serverok/c0853120baff8848054cfb598e389c3a

    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.

    yum install yum-utils
    

    To list all duplicate packages, run

    package-cleanup --dupes
    

    To remove all duplicate packages, run

    package-cleanup --cleandupes
    

    Now do a yum update

    yum update
    

    This will update your system and install any missing packages.

    To verify if there any problem, run

    package-cleanup --problems
    

    If this does not fix, try yum fix duplicate package error

    See yum