(6) Update glibc version

The glibc version is too low, causing individual scripts to execute errors, such as the following errors

1. Check the version supported by the system glibc

 strings /lib64/libc.so.6 |grep GLIBC_ 

 

It can be seen that only version 2.12 is supported at most, so consider compiling to solve this problem:

2. Go to http://ftp.gnu.org/gnu/glibc/ to download the latest glibc version

I downloaded the version of glibc-2.14.tar.xz here, extracted it to any directory and prepared to compile

   Unzip here to /home/VMdisks/glibc-2.14/

3. Create a build directory in the glibc source directory, and cd into the build directory

[ghui@StuOS glibc-2.14]$ mkdir build  

[ghui@StuOS glibc-2.14]$ cd build  

4. Run configure, make && sudo make install

1. [ghui@StuOS build]$ ../configure --prefix=/opt/glibc-2.14  

2. [ghui@StuOS build]$ make -j4   

3. [ghui@StuOS build]$ sudo make install  

5. Temporarily modify environment variables

1. [ghui@StuOS bin]$ export LD_LIBRARY_PATH=/opt/glibc-2.14/lib:$LD_LIBRARY_PATH  

6. Modify the soft connection.

It should be noted here that updating the links in the system (mine is /lib64/libc.so.6) is easy to make mistakes. I don't know if there is a better way. Generally, it is to delete the old link and create a new link. But after deleting the old link, many commands can't be used directly, because there is no glibc library at this time. At this time, you need to temporarily specify a glibc library, the method is as follows (libc.so is renamed in order to distinguish other versions that will be updated later):

1. [ghui@StuOS bin]$ cp/opt/glibc-2.14/lib/libc-2.14.so /lib64/libc-2.14.so

2.  [ghui @ StuOS bin] $ rm – f /lib64/libc.so.6

3. [ghui@StuOS bin]$ LD_PRELOAD=/lib64/libc.so.6ln -s /lib64/libc-2.14.so /lib64/libc.so.6

4. [ghui@StuOS bin]$strings /lib64/libc.so.6 |grep GLIBC


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325480627&siteId=291194637