Resolving Duplicate glibc Packages on a CentOS Server

Here’s an unusual one – yum crashed in the middle of an update and somehow recorded multiple versions of glibc and glibc-common being installed, preventing Yum from updating:

[root@server ~]# package-cleanup --dupes
Loaded plugins: dellsysid, fastestmirror
glibc-2.12-1.166.el6_7.3.x86_64
glibc-2.12-1.166.el6_7.3.x86_64
glibc-2.12-1.166.el6_7.3.x86_64
glibc-2.12-1.166.el6_7.3.x86_64
glibc-2.12-1.166.el6_7.3.x86_64
glibc-2.12-1.166.el6_7.3.x86_64
glibc-2.12-1.166.el6_7.3.x86_64
glibc-2.12-1.166.el6_7.3.i686
glibc-2.12-1.166.el6_7.3.i686
glibc-2.12-1.166.el6_7.3.i686
glibc-2.12-1.166.el6_7.3.i686
glibc-2.12-1.166.el6_7.3.i686
glibc-common-2.12-1.166.el6_7.3.x86_64
glibc-common-2.12-1.166.el6_7.3.x86_64
glibc-common-2.12-1.166.el6_7.3.x86_64
glibc-common-2.12-1.166.el6_7.3.x86_64
glibc-common-2.12-1.166.el6_7.3.x86_64
glibc-common-2.12-1.166.el6_7.3.x86_64
glibc-common-2.12-1.166.el6_7.3.x86_64

Glibc is one of those base packages that nearly everything on the OS relies on.  Normally when you have duplicate packages, you can simply run the following command to resolve it:

package-cleanup --cleandupes

But, running this command on a server where glibc is one of the duplicate packages is extremely dangerous.  Doing this will attempt to remove everything that relies on glibc as a dependency.  In other words, you’re going to end up effectively removing CentOS.

So how do we fix this, you ask?  Just tell the rpmdb the package isn’t installed anymore:

rpm -e --nodeps --justdb glibc-2.12-1.166.el6_7.3.i686 --allmatches
rpm -e --nodeps --justdb glibc-common-2.12-1.166.el6_7.3.x86_64 --allmatches

Then reinstall both:

yum install glibc glibc.i686 glibc-common

This should safely resolve the issue.

 

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *