Skip to content

Instantly share code, notes, and snippets.

@bigendiansmalls
Created January 23, 2017 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigendiansmalls/fbfdda75b3e08e9c9c33a6d415fc967b to your computer and use it in GitHub Desktop.
Save bigendiansmalls/fbfdda75b3e08e9c9c33a6d415fc967b to your computer and use it in GitHub Desktop.
rollback glibc for CentOS 7.3.1611 to version included with 7.2.1511
#!/bin/bash
# script to roll GLIBC back on CentOS 7.3 to version below
# no warranty of any kind, use at your own risk.
VER="-2.17-106.el7_2.6"
LIBS=$(echo -n $(yum list installed|grep glibc|awk ' { print $1 } '|cut -d '.' -f1)|sed "s/ /${VER} /g")${VER}
echo ${LIBS}
exit
function testrc {
"$@"
local status=$?
if [ $status -ne 0 ]; then
echo "error with $1"
echo "exiting"
exit 1
fi
return $status
}
# enable the requisite repos
testrc yum-config-manager --enable C7.2.1511-base >/dev/null 2>&1
testrc yum-config-manager --enable C7.2.1511-updates >/dev/null 2>&1
# downgrade the glibc
testrc yum downgrade ${LIBS}
# diable the repos
testrc yum-config-manager --disable C7.2.1511-base >/dev/null 2>&1
testrc yum-config-manager --disable C7.2.1511-updates >/dev/null 2>&1
# display enabled repos (optional)
# testrc yum repolist enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment