问题管理
glibc升级
本文档使用 MrDoc 发布
-
+
home page
glibc升级
# rpm升级 gcc -v 查看gcc版本 ldd --versio 查看glibc版本 ```shell #! /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 -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 --force --nodeps ## 私服 cd /tmp/ wget https://repository.jcfc.cn/repository/soft/glibc/glibc-devel-2.17-55.el6.x86_64.rpm wget https://repository.jcfc.cn/repository/soft/glibc/glibc-2.17-55.el6.x86_64.rpm wget https://repository.jcfc.cn/repository/soft/glibc/glibc-common-2.17-55.el6.x86_64.rpm wget https://repository.jcfc.cn/repository/soft/glibc/glibc-headers-2.17-55.el6.x86_64.rpm sudo rpm -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 --force --nodeps ``` # 源码包 安装glibc-2.14步骤: 下载安装包:http://ftp.gnu.org/gnu/glibc/ ```shell mkdir /tmp/glibcup cd /tmp/glibcup wget http://repository.jcfc.cn/repository/soft/glibc/glibc-2.14.tar.gz wget http://repository.jcfc.cn/repository/soft/glibc/glibc-ports-2.14.tar.gz tar -zxvf glibc-2.14.tar.gz tar -zxvf glibc-ports-2.14.tar.gz mv glibc-ports-2.14 glibc-2.14/ports mkdir glibc-2.14/build cd /tmp/glibcup/glibc-2.14/build ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin make make install ll /lib64/libc.so.6 strings /lib64/libc.so.6 |grep GLIBC_ ``` #创建软连接: ln -s /usr/local/glibc-2.14.1/lib/libc-2.14.1.so /lib64/libc.so.6 #失败后的回退: ```shell ls -l /lib64|grep 2.14|grep lrw|awk '{print "ln -snf "$11" "$9}'|sed 's/2.14/2.12/g' ``` #系统命令不能使用时候,我们执行下面命令,临时修改环境变量: export LD_LIBRARY_PATH=/usr/local/glibc-2.14.1/lib:$LD_LIBRARY_PATH #使用命令查看是否有GLIBC_2.14: strings libc.so.6|grep GLIBC_* GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_PRIVATE # 问题 升级glibc库后,使用SecureCRT登录linux,提示: ``` Last login: Mon Feb 20 02:03:21 2017 from 192.168.4.187 -bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory -bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory -bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory -bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory -bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory ``` 解决方案,修改如下: ``` vi /etc/sysconfig/i18n #添加下面的 LC_ALL=C export LC_ALL #再执行下面的语句,使之生效 source /etc/sysconfig/i18n ```
rongkang
Oct. 18, 2024, 12:02 a.m.
转发文档
Collection documents
Last
Next
手机扫码
Copy link
手机扫一扫转发分享
Copy link
Markdown文件
share
link
type
password
Update password