Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of CentOS6.5 upgrade from glibc-2.12 to glibc-2.15

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the example analysis of CentOS6.5 upgrade from glibc-2.12 to glibc-2.15. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

The package that the project depends on at development time requires a later version of the glibc library, while the default version of glibc in Centos6.5 is 2.12, so you may encounter errors when debugging. But if you accidentally delete the libc.so.6 in the dynamic library, all non-system commands will be unavailable instantly, and an error will be reported if you use it. Because libc.so.6 is the soft link of the c runtime library glibc, and almost all programs in the system rely on the c runtime library. When the program starts and runs, it is based on the libc.so.6 soft link to find the glibc library. Deleting libc.so.6 will cause almost all programs on the system to fail to work.

Each glibc.so file has its supported libc version, which can be viewed through strings / lib64/libc.so.6 | grep GLIBC. Be sure to select the version listed in this command.

[root@test1 ~] # strings / lib64/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_2.15

GLIBC_PRIVATE

If the version of the linked libc library when the program is compiled is not within the libc version supported by the glibc library in the running environment of the program, it will also report an error. As a result, all the commands of the system, such as ls,cp,cd, are unavailable. We can find the version you want here, http://ftp.gnu.org/gnu/glibc/, and then unpack it and install it.

First, check the glibc version of this machine.

[root@test1 ~] # / lib64/libc.so.6

GNU C Library stable release version 2.12, by Roland McGrath et al.

Copyright (C) 2010 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

Compiled by GNU CC version 4.4.7 20120313 (Red Hat 4.4.7-4).

Compiled on a Linux 2.6.32 system on 2013-11-05.

Available extensions:

The C stubs add-on version 2.1.2.

Crypt add-on version 2.1 by Michael Glad and others

GNU Libidn by Simon Josefsson

Native POSIX Threads Library by Ulrich Drepper et al

BIND-8.2.3-T5B

RT using linux kernel aio

Libc ABIs: UNIQUE IFUNC

For bug reporting instructions, please see:

.

II. Compilation and installation

[root@test1 ~] # mkdir-pv / path/to/glibc-2.15/build

[root@test1 ~] # cd / path/to/glibc-2.15/

[root@test1 ~] # wget http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.gz

[root@test1 ~] # tar xzvf glibc-2.15.tar.gz

[root@test1 ~] # cd / path/to/glibc-2.15/build

[root@test1 build] #.. / glibc-2.15/configure-prefix=/usr-disable-profile-enable-add-ons-with-headers=/usr/include-with-binutils=/usr/bin

This step is critical. Do not execute / configure in the directory where glibc is extracted.

Checking build system type... X86_64-unknown-linux-gnu

Checking host system type... X86_64-unknown-linux-gnu

Checking for gcc... No

Checking for cc... No

Checking for cl.exe... No

Configure: error: in / path/to/glibc-2.15/build':configure: error: no acceptable C compiler found in $PATHSeeconfig.log' for more details

This error indicates that you do not have gcc and cc compiled packages.

To install the gcc cc compiler package, install it using yum. Then make, make install

Third, check and verify

[root@test1 build] # ll / lib64/libc*

-rwxr-xr-x 1 root root 1926800 Nov 6 2013 / lib64/libc-2.12.so

-rwxr-xr-x 1 root root 9801125 Apr 22 11:19 / lib64/libc-2.15.so

Lrwxrwxrwx. 1 root root 18 Oct 10 2018 / lib64/libcap-ng.so.0-> libcap-ng.so.0.0.0

-rwxr-xr-x. 1 root root 18672 Nov 5 2010 / lib64/libcap-ng.so.0.0.0

Lrwxrwxrwx. 1 root root 14 Oct 10 2018 / lib64/libcap.so.2-> libcap.so.2.16

-rwxr-xr-x 1 root root 19016 Aug 23 2011 / lib64/libcap.so.2.16

-rwxr-xr-x. 1 root root 197064 Nov 6 2013 / lib64/libcidn-2.12.so

-rwxr-xr-x 1 root root 267972 Apr 22 11:19 / lib64/libcidn-2.15.so

Lrwxrwxrwx 1 root root 15 Apr 22 11:19 / lib64/libcidn.so.1-> libcidn-2.15.so

Lrwxrwxrwx. 1 root root 17 Oct 10 2018 / lib64/libcom_err.so.2-> libcom_err.so.2.1

-rwxr-xr-x 1 root root 17256 Aug 13 2013 / lib64/libcom_err.so.2.1

-rwxr-xr-x 1 root root 43392 Nov 6 2013 / lib64/libcrypt-2.12.so

-rwxr-xr-x 1 root root 142947 Apr 22 11:19 / lib64/libcrypt-2.15.so

Lrwxrwxrwx. 1 root root 22 Oct 10 2018 / lib64/libcryptsetup.so.1-> libcryptsetup.so.1.1.0

-rwxr-xr-x 1 root root 97072 Feb 29 2012 / lib64/libcryptsetup.so.1.1.0

Lrwxrwxrwx 1 root root 16 Apr 22 11:19 / lib64/libcrypt.so.1-> libcrypt-2.15.so

Lrwxrwxrwx 1 root root 12 Apr 22 11:19 / lib64/libc.so.6-> libc-2.15.so

We can see that version 2.12 of the old library file still exists, and there are more version 2.15 library files, and the soft link files all point to version 2.15.

Confirm again that the found version has been updated to version 2.15 and there is no need to restart.

[root@test1 build] # / lib64/libc.so.6

GNU C Library stable release version 2.15, by Roland McGrath et al.

Copyright (C) 2012 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

Compiled by GNU CC version 4.4.7 20120313 (Red Hat 4.4.7-23).

Compiled on a Linux 2.6.32 system on 2019-04-22.

Available extensions:

Crypt add-on version 2.1 by Michael Glad and others

GNU Libidn by Simon Josefsson

Native POSIX Threads Library by Ulrich Drepper et al

BIND-8.2.3-T5B

Libc ABIs: UNIQUE IFUNC

For bug reporting instructions, please see:

.

Note:

1. Do not execute the. / configure instruction directly in the glibc source package, or you will be abused. If the location of the installation package is: / path/to/glibc-2.15, the correct posture is to create a primary directory and execute the. / configure instruction in that directory.

2. Do not install glibc to the default directory [/ usr/local] or [any custom directory], be sure to install it to the [/ usr] directory, or you will be abused.

This is the end of this article on "sample Analysis of CentOS6.5 upgrade from glibc-2.12 to glibc-2.15". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report