shell脚本一键升级glibc 2.17
centos6的gilbc版本的确是有点太低了,许多应用依赖的包都需要更高glibc版本来支持,升级glibc之前可以去先把gcc升级了,gcc的升级教程可以看这篇文章linux yum升级gcc版本.
系统:centos 6.x(64位)
脚本内容:
cat ~/soft_shell/update_glibc.sh
#! /bin/sh # update glibc to 2.17 for CentOS 6 wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm sudo rpm --force --nodeps -Uvh glibc-2.17-55.el6.x86_64.rpm \ glibc-common-2.17-55.el6.x86_64.rpm \ glibc-devel-2.17-55.el6.x86_64.rpm \ glibc-headers-2.17-55.el6.x86_64.rpm ldconfig echo -e "\033[40;31mCheck glibc version......\033[40;37m" strings /lib64/libc.so.6 |grep GLIBC_
好了,升级glibc到这里就完成了,如果有的朋友删除libc.so.6之后可能导致系统命令不可用的情况,可使用如下方法解决:
LD_PRELOAD=/lib64/libc-2.12.so ln -s /lib64/libc-2.12.so /lib64/libc.so.6
ps:libc-2.12.so 此项是系统升级前的版本
评论: