CentOS下glibc更新


使用java -agentpath=xxx時報該錯,提示glibc版本過低:version `GLIBC_2.14' not found (required by /data/jjns/UEISecurity_JVM.dll)。

查看當前glibc版本:

ll /lib64/libc.so.6
lrwxrwxrwx. 1 root root 12 Apr 14 16:14 /lib64/libc.so.6 -> libc-2.12.so

說明當前glibc版本為2.12,需要glibc2.14,於是進行glibc更新操作

1. 從glibc官網(http://ftp.gnu.org/gnu/glibc)下載源碼包:glibc-2.14.tar.bz2及glibc-linuxthreads-2.5.tar.bz2。

2. 在任意目錄新建文件夾,存放解壓文件,例如:

mkdir /data/test

3. 進入新建的目錄

cd /data/test

4. 解壓源碼包glibc-2.14.tar.bz2,並進入解壓文件夾

tar -jxvf /home/xx/software/glibc-2.14.tar.bz2
cd glibc-2.14/

5. 解壓源碼包glibc-linuxthreads-2.5.tar.bz2

tar -jxvf /home/xx/software/glibc-linuxthreads-2.5.tar.bz2

6. 返回上級目錄,重要

cd ..

7. 加上優化開關,否則會出現錯誤,必須用root用戶

export CFLAGS="-g -O2"

8. 編譯前配置參數

./glibc-2.14/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin

9. 編譯,執行很久,可能出錯,出錯再重新執行(我未出錯)

make

10. 安裝

make install

我遇到報錯如下,但檢查第11步顯示仍然成功:

 1 Execution of gcc failed!
 2 The script has found some problems with your installation!
 3 Please read the FAQ and the README file and check the following:
 4 - Did you change the gcc specs file (necessary after upgrading from
 5   Linux libc5)?
 6 - Are there any symbolic links of the form libXXX.so to old libraries?
 7   Links like libm.so -> libm.so.5 (where libm.so.5 is an old library) are wrong,
 8   libm.so should point to the newly installed glibc file - and there should be
 9   only one such link (check e.g. /lib and /usr/lib)
10 You should restart this script from your build directory after you've
11 fixed all problems!
12 Btw. the script doesn't work if you're installing GNU libc not as your
13 primary library!
14 make[1]: *** [install] Error 1
15 make[1]: Leaving directory `/usr/src/glibc'
16 make: *** [install] 錯誤 2

 

11. 檢查更新后版本,顯示2.14即更新成功

ll /lib64/libc.so.6
lrwxrwxrwx 1 root root 12 Jun 25 02:07 /lib64/libc.so.6 -> libc-2.14.so

 

參考文檔:http://blog.csdn.net/rosen_luo/article/details/49450969


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM