Skip to content

Instantly share code, notes, and snippets.

@jhult
Forked from harv/glibc-2.17_centos6.sh
Last active July 18, 2022 00:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jhult/3c0d7cb5febb2348aa2166c0342e4fd1 to your computer and use it in GitHub Desktop.
Save jhult/3c0d7cb5febb2348aa2166c0342e4fd1 to your computer and use it in GitHub Desktop.
update glibc to 2.17 for CentOS 6
#!/bin/bash
# update glibc to 2.17 for CentOS 6
GLIBC=glibc
OS=el6
SERVER=https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6
VERSION=2.17-55
FULL_VERSION=$GLIBC-$VERSION.fc20
X64=x86_64
I386=i386
I636=i686
REPO_32=epel-6-$I386
REPO_64=epel-6-$X64
SERVER_32=$SERVER/$REPO_32/$FULL_VERSION
RPM_32=$VERSION.$OS.$I636.rpm
SERVER_64=$SERVER/$REPO_64/$FULL_VERSION
RPM_64=$VERSION.$OS.$X64.rpm
# Packages
P_1=$GLIBC
P_2=$GLIBC-common
P_3=$GLIBC-devel
P_4=$GLIBC-headers
P_5=$GLIBC-static
P_6=$GLIBC-utils
P_7=nscd
# Required as dependency of glibc-utils
sudo yum install --assumeyes gd
# 64-bit
sudo rpm -Uvh --force $SERVER_64/$P_1-$RPM_64 $SERVER_64/$P_2-$RPM_64 $SERVER_64/$P_3-$RPM_64 $SERVER_64/$P_4-$RPM_64 $SERVER_64/$P_5-$RPM_64 $SERVER_64/$P_6-$RPM_64 $SERVER_64/$P_7-$RPM_64
# Print out versions
strings /lib64/libc.so.6 | grep GLIBC
# 32-bit
# sudo rpm -Uvh --force $SERVER_32/$P_1-$RPM_32 $SERVER_32/$P_2-$RPM_32 $SERVER_32/$P_3-$RPM_32 $SERVER_32/$P_4-$RPM_32 $SERVER_32/$P_5-$RPM_32 $SERVER_32/$P_6-$RPM_32 $SERVER_32/$P_7-$RPM_32
@AdrianoMele
Copy link

hi, I tried this code and apparently it works. However, upgrading glibc did not solve my problem. Is there a way to go back to the original version?

thanks

@jhult
Copy link
Author

jhult commented Mar 7, 2022

@AdrianoMele, unfortunately I don't know the answer. If you find out how to revert to an older version, please post the steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment