Linux – How to fix dependency issue with partially completed yum update of glibc

amazon-linuxcentoslinuxyum

I attempted to update my production web server this morning (t2 running Amazon Linux) but it failed because I ran out of RAM (php-fpm had it all). I stopped php-fpm to free up some RAM, but the yum update won't complete. The server is running ok, but I'd like to clean up this problem.

# yum update
Resolving Dependencies
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.17-106.168.amzn1 will be updated
--> Processing Dependency: glibc-headers = 2.17-106.168.amzn1 for package: glibc-devel-2.17-106.168.amzn1.x86_64
---> Package glibc-headers.x86_64 0:2.17-157.169.amzn1 will be an update
--> Finished Dependency Resolution
Error: Package: glibc-devel-2.17-106.168.amzn1.x86_64 (@amzn-main)
       Requires: glibc-headers = 2.17-106.168.amzn1
       Removing: glibc-headers-2.17-106.168.amzn1.x86_64 (@amzn-main)
           glibc-headers = 2.17-106.168.amzn1
       Updated By: glibc-headers-2.17-157.169.amzn1.x86_64 (amzn-updates)
           glibc-headers = 2.17-157.169.amzn1
You could try using --skip-broken to work around the problem
** Found 6 pre-existing rpmdb problem(s), 'yum check' output follows:
glibc-devel-2.17-106.168.amzn1.x86_64 has missing requires of glibc(x86-64) = ('0', '2.17', '106.168.amzn1')
glibc-devel-2.17-157.169.amzn1.x86_64 is a duplicate with glibc-devel-2.17-106.168.amzn1.x86_64
glibc-devel-2.17-157.169.amzn1.x86_64 has missing requires of glibc-headers = ('0', '2.17', '157.169.amzn1')
glibc-headers-2.17-106.168.amzn1.x86_64 has missing requires of glibc(x86-64) = ('0', '2.17', '106.168.amzn1')
subversion-1.9.4-2.55.amzn1.x86_64 has missing requires of subversion-libs(x86-64) = ('0', '1.9.4', '2.55.amzn1')
subversion-1.9.5-1.56.amzn1.x86_64 is a duplicate with subversion-1.9.4-2.55.amzn1.x86_64

Here's the glibc packages that are installed

# rpm -qa | grep glibc
glibc-devel-2.17-157.169.amzn1.x86_64
glibc-devel-2.17-106.168.amzn1.x86_64
glibc-common-2.17-157.169.amzn1.x86_64
glibc-headers-2.17-106.168.amzn1.x86_64
glibc-2.17-157.169.amzn1.x86_64

One problem appears to be two different versions of glibc-devel are installed. It also looks like parts of glibc are on version 106 and others are on version 157.

I rebooted the server, which as expected made no difference, but it was worth a shot. I ran the following, with no effect

yum-complete-transaction
yum-complete-transaction --cleanup-only
yum clean all

In the past I've had similar problems but with less critical packages. I just remove them all and them install them again. I don't believe this is possible with glibc as so many things depend on it.

I've looked on the Centos forums and one option seems to be downgrading some packages to downgrade some packages, but I don't know if there's a better option. Since this is my production server I would appreciate some advice before I attempt this. If this is a good approach which packages should I downgrade? What do I do after I've downgraded, a regular yum update?

Note that I have regular backups and can restore from a recent backup if required, but I'd prefer not to as I'd have to redo some SSL certificate work that was a bit tricky. I plan to move to Ubuntu and use CloudFormation to build the server in the future, so if the server fails I can simply create another, but that's a future task.

Best Answer

Thanks for the suggestion of using rollback. I tried it but it didn't roll things back properly.

I created another instance of the VM and tried to do things manually. Noting from above that I had two versions of glibc-devel I did the following

yum remove glibc-devel-2.17-157.169.amzn1.x86_64
yum update glibc-devel-2.17-106.168.amzn1.x86_64

At that point I did a "yum check" and it told me there was a problem with subversion as well.

yum remove subversion
yum install subversion
yum clean all
yum check

This appears to have resolved the issue.