Linuxでglibc-2.14の問題をアップグレードする



Upgrade Glibc 2 14 Problem Under Linux



発生した問題

.binファイルを実行する場合

libc.so.6: version GLIBC_2.14 not found

エラーはcentosシステムの安定性によるもので、使用されているcランタイムのバージョンが低く、合格しています



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

システムにインストールされているglibcのバージョンを表示できます。一般的なcentosシステムは2.12にのみインストールされます。

glibc-2.14をインストールします

ダウンロードリンク glibc-2.14バージョンをダウンロード



選択できます glibc-2.14.tar.gz

ダウンロードしたtarballを/ home /ディレクトリなどのディレクトリに配置します。次のシェルコマンドの実行を開始します。

[root@xxxxx home]# tar -xzvf glibc-2.14.tar.gz //Unzip the package [root@xxxxx home]# cd glibc-2.14 //Enter the decompressed file directory [root@xxxxx glibc-2.14]# mkdir build //Create build folder [root@xxxxx glibc-2.14]# cd build //Enter the build folder [root@xxxxx build]# ../configure --prefix=/opt/glibc-2.14 // Configure glibc and set the current glibc-2.14 installation directory bit /opt/glibc-2.14 (installation directory can choose), remember This installation directory, the latter operation needs to be used [root@xxxxx build]# make -j4 //Enable compilation acceleration 4 processes [root@xxxxx build]# make install //Start installation

次に、インストールが完了するのを待ちます



Glibcソフトチェーン

インストールが完了したら、glibc-2.14を指すソフトチェーンを作成し、次のコマンドを実行します。

$ rm -rf /lib64/libc.so.6 // Remove the previous libc.so.6 soft chain first $ ln -s /opt/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6 //Create a new soft connection

注意

libc.so.6を削除すると、システムコマンドが使用できなくなる可能性があるため、次の方法を使用して2.14のリンクを作成できます。

$ LD_PRELOAD=/opt/glibc-2.14/lib/libc-2.14.so ln -s /opt/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6

上記の更新が失敗した場合は、次のコマンドを使用してバージョン2.12に復元できます。

$ LD_PRELOAD=/lib64/libc-2.12.so ln -s /lib64/libc-2.12.so /lib64/libc.so.6

この時点で、コマンドでglibcを表示して、新しくインストールされたGLIBC_2.14を下部に表示できます。