7

I'm trying to install git on a developer box and I get the following:

You could try using --skip-broken to work around the problem
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
kernel-2.6.32-431.17.1.el6.x86_64 has installed conflicts bfa-firmware < ('0', '3.2.21.1',     '2'): bfa-firmware-3.0.3.1-1.el6.noarch
kernel-firmware-2.6.32-431.17.1.el6.noarch is a duplicate with kernel-firmware-2.6.32-358.23.2.el6.noarch
kernel-headers-2.6.32-431.17.1.el6.x86_64 is a duplicate with kernel-headers-2.6.32-358.23.2.el6.x86_64

How can I resolve this? I'm not too familiar with CentOS/RHEL

Thanks

7

Root Cause

Interruption in the up2date or yum update process caused the installation of multiple versions of the same package.

Resolution

  1. If the system is Red Hat Enterprise Linux 5 or later, the package-cleanup command can be used:

$ package-cleanup --dupes $ package-cleanup --cleandupes

The --dupes command will list the duplicate packages installed on the machine, while the --cleandupes switch will remove the older versions. package-cleanup command is provided by the yum-utils package.

  1. If package-cleanup does not help or the system is Red Hat Enterprise Linux 4, remove packages manually using rpm:

$ rpm -e --justdb <package-name>-<old-version>

The '--justdb' switch is used to ensure that the package removal does not remove its files from the file system, removing it only from the rpm database.

Some duplicates may not removed because they are required by installed packages. You can try --cleandupes with --removenewestdupes, or review them with --dupes and remove manually.

1
  • This solution still works as of CentOS/RedHat 7. – Craig Finch Nov 2 '19 at 19:59
3

WARNING: Solving problems like these will always be both dangerous and tedious. Please understand that some of the packages in your system are critical to the function of the system. Making changes involving such packages can be more difficult. Make sure you understand whatever you are thinking of doing, watch out for details, ask around for help, make backups/snapshots before trying anything as it's easy to make things worse instead of better. For some changes it may be necessary to boot a rescue disk so that you don't have to rely on the system you are trying to fix.

--

In my case I found that something had gone wrong and many packages had been updated without the older versions being removed. Attempts to rebuild the RPM DB did not solve the problem.

One solution that is working is simply to remove the older version and reinstall the newer version.

Looking at the error output each line basically says Update Package is a duplicate with Previous Package, ie:

    kernel-headers-2.6.32-431.17.1.el6.x86_64 is a duplicate with kernel-headers-2.6.32-358.23.2.el6.x86_64

The following seems to work for me:

    rpm --erase --nodeps --noscript kernel-headers-2.6.32-358.23.2.el6.x86_64

The command tells RPM to remove the specific Previous Package without removing any dependencies or running any scripts associated with the task.

Next the package needs to be reinstalled:

    yum reinstall kernel-headers

This time there's no need to specify the exact package version as yum will look for the most recent version and reinstall it.

Yum will output the result of its Yum Check operation during each run. Keep doing this until there are no more duplicate packages listed.

Note that you can query the RPM database directly. If you see lots of messages that include the string glibc, for example, you can get a simple list of packages which have that string in their names like this:

    rpm -qa | grep glibc | sort

Which might produce something like:

    glibc-2.17-157.el7_3.5.x86_64
    glibc-common-2.17-157.el7_3.4.x86_64
    glibc-common-2.17-157.el7_3.5.x86_64
    glibc-devel-2.17-157.el7_3.5.x86_64
    glibc-headers-2.17-157.el7_3.5.x86_64

Now it's more obvious that the previous version of glibc-common must be removed:

    rpm --erase --nodeps --noscript glibc-common-2.17-157.el7_3.4.x86_64
    yum reinstall glibc-common
4
  • This guide messed up my OS completely broken and now it is helpless state with ld-linux-x86-64.so.2: bad ELF interpreter:. ISFPON – Seandex May 28 '20 at 18:38
  • Solving problems like these will always be both dangerous and tedious. Please understand that some of the packages in your system are critical to the function of the system. Making changes involving such packages can be more difficult. Make sure you understand whatever you are thinking of doing, watch out for details, ask around for help, make backups/snapshots before trying anything as it's easy to make things worse instead of better. For some changes it may be necessary to boot a rescue disk so that you don't have to rely on the system you are trying to fix. – Sam Azer Jun 10 '20 at 16:13
  • I understand, however putting that disclaimer before the solution would avoid further additional disasters for others when handling the critical kernel questions that do require multiple experiences. – Seandex Jun 18 '20 at 21:18
  • Done. I do hope this might help but I wonder. – Sam Azer Jun 29 '20 at 19:38
0

Try executing following command

yum clean all
rpm --rebuilddb
yum update
yum clean all
yum reinstall glibc glibc-common libgcc
yum upgrade
yum install yum-utils
package-cleanup --problems
package-cleanup --dupes
1
  • 2
    Didn't work for me as written, but some useful info there. The last 2 steps output the broken-list. What finally resolved some of the problems, was to keep downgrading, then upgrading, everything broken with all extra repos disabled, and then rebuilding the db (your step #2) between each downgrade/upgrade step. Lots of trial and error involved. – JosephK Mar 13 '16 at 12:26
0

I was facing similar problems in updating security patches on RHEL7.8. The solution that has worked was to enable all repositories on your instance and update the glibc packages. These were the steps:

- Create a backup of repositories configuration

  # cp /etc/yum.repos.d/redhat-rhui.repo /tmp/
  

- Enabled all repositories

  # sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/redhat-rhui.repo
  
  
- Update glibc packages

  # yum update glibc*
  
  
- Revert repositories configuration

  # yum clean all

  # cp /tmp/redhat-rhui.repo /etc/yum.repos.d/redhat-rhui.repo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.