I do not know how to upgrade glibc from version 2.12 to 2.14 on CentOS 6.3. I need your help.
4 Answers
You cannot update glibc on Centos 6 safely. However you can install 2.14 alongside 2.12 easily, then use it to compile projects etc. Here is how:
mkdir ~/glibc_install; cd ~/glibc_install
wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
tar zxvf glibc-2.14.tar.gz
cd glibc-2.14
mkdir build
cd build
../configure --prefix=/opt/glibc-2.14
make -j4
sudo make install
export LD_LIBRARY_PATH=/opt/glibc-2.14/lib

- 325
- 3
- 11

- 1,062
- 7
- 15
-
when I try to do that, `configure` tells me that my version of `gcc` is too old (**5.3.1** on my system) – valentin Feb 23 '17 at 14:20
-
unlucky, some programs have to work with old ones, and some use new ones. I am also troubled with this version problem! – wuhaochi Mar 01 '17 at 12:30
-
@valentin much like glibc you could install a different version of it alongside your other version, then point to it with export CC=/path/to/gcc – UnitasBrooks Mar 03 '17 at 21:59
-
6It says gcc 5.3.1 is too old, but it's actually too new. It's looking for gcc 3.4 or 4.x. For CentOS 6, just use the stock gcc 4.4 (as opposed to 5.3.1 from devtoolset-4). Alternatively, you can hack config.in to accept your version, rerun autoconf, and see if it will work. – Trevor Robinson Apr 11 '17 at 15:20
-
1Note that this is also useful for running binaries compiled to work with 2.14 (not just for "[compiling projects]"). Thanks for your answer! Very helpful. – rinogo Jun 29 '17 at 22:56
-
3**NB:** It is necessary to run all programs with an explicit dynamic linker invocation. Just setting `LD_LIBRARY_PATH` can break tomorrow (e.g., if the internal `GLIBC_PRIVATE` ABI between `ld.so` and `libc.so.6` changes). – Florian Weimer Jul 17 '17 at 18:35
-
4I am running into error `Can't open configuration file /opt/glibc-2.14/etc/ld.so.conf: No such file or directory` when I follow these steps ,any clues on why and how to fix it? – wisecrack Feb 09 '18 at 16:23
-
That's odd, you could try to and just: touch /opt/glibc-2.14/ld.so.conf Likely you have some permissions issue that stopped that file from getting generated. – UnitasBrooks Feb 13 '18 at 18:04
-
I get a `selinux.c:37:23: error: libaudit.h: No such file or directory` when running `make -j4`; has anyone seen that? – Keith Johnson Apr 17 '18 at 00:52
-
1Setting LD_LIBRARY_PATH that way is not recommended: https://www.hpc.dtu.dk/?page_id=1180 – luismartingil May 11 '18 at 12:05
-
@luismartingil you can use gcc flags instead if you'd like gcc
-L/opt//opt/glibc-2.14/lib – UnitasBrooks Sep 04 '18 at 21:47 -
1If you meet the error: `glibc compile Inconsistency detected by ld.so: dynamic-link.h: 210: elf_get_dynamic_info: Assertion info[29] == ((void *)0) failed!` or similar thing, you may `unset LD_LIBRARY_PATH` and `unset LD_RUN_PATH` first, then try to configure and make. – Syrtis Major Jan 16 '19 at 06:59
-
between step 6 and 7, if CentOS has not installed gcc yet, we should install gcc first `yum install gcc` – Ferris Feb 07 '19 at 04:06
-
OK, I corrupt the files, how can I reinstall this or uninstall it ? – Accountant م Apr 17 '19 at 21:32
-
1@user3682248 Yes I got your error, the fix is [here](https://unix.stackexchange.com/questions/513265/what-does-this-line-mean-opt-glibc-2-14-etc-sudo-sh-c-echo-usr-local-lib) . **This is a [very useful resource](http://leistech.blogspot.com/2015/06/glibc-installation.html) for fixing most of the problems you will encounter while trying this** – Accountant م Apr 18 '19 at 20:04
-
To set the timezone for the new gclib: `ln -s /usr/share/zoneinfo/Europe/Rome /usr/glibc/etc/localtime` as it won’t use your system timezone. Check with: `/opt/glibc-2.14/lib/ld-2.14.so --library-path "/opt/glibc-2.14/lib:/lib64" /bin/date` – Marco Marsala Mar 18 '21 at 16:14
I found this source very useful and doesn't has much SEO. It lists the most common errors you might encounter while using @UnitasBrooks great answer and I'm afraid it gets lost in the future.
This is the link to the original post
I will copy, paste it here (I faced the last problem and it fixed it, however I didn't try all the problems/solutions listed and you try it on your own risk)
Glibc installation
The GNU C Library, commonly known as glibc, is the GNU Project's implementation of the C standard library. My environment required glibc (version 2.14) and it took a bit of fiddling to get it to work, so hopefully this will save you some time.
0.Glibc Installation Dependencies
Bash: sh
Binutils: ar, as, ld, ranlib, readelf
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mknod, mv, mkdir, rm, touch
Gcc: cc, cc1, collect2, cpp, gcc
Grep: egrep, grep
Gzip: gzip
Make: make
Gawk: gawk
Sed: sed
Sh-utils: date, expr, hostname, pwd, uname
Texinfo: install-info, makeinfo
Textutils: cat, cut, sort, tr
1.Download installation package
http://www.gnu.org/software/libc/ for all versions.
http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz for version 2.14.
2.Compile and install
To avoid disturb current environment, compile and install this version separately by configuring prefix.
[root@localhost ~]# tar xvf glibc-2.14.tar.gz
[root@localhost ~]# cd glibc-2.14
[root@localhost glibc-2.14]# mkdir build
[root@localhost glibc-2.14]# cd ./build
[root@localhost build]# ../configure --prefix=/opt/glibc-2.14
[root@localhost build]# make -j4
[root@localhost build]# make install
[root@localhost build]# export LD_LIBRARY_PATH=/opt/glibc-2.14/lib:$LD_LIBRARY_PATH
3.To check glibc versions installed
root@localhost:~/intel64/runtime/glibc$ 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_PRIVATE
4.Compiling errors
Error:
make[1]: *** No rule to make target
/mnt/lfs/sourcenew/glibc-build/Versions.all', needed by
/mnt/lfs/sourcenew/glibc-build/abi-versions.h'. Stop.
Solution:
sudo apt-get install gawk
sudo apt-get install texinfo
Error:
make[2]: *** [/mnt/lfs/sources/glibc-build/misc/syslog.o] Error 1
Solution:
make clean
make -j2 CFLAGS="-U_FORTIFY_SOURCE -O2 -fno-stack-protector"
Error:
/Downloads/glibc-2.14/build/elf/ldconfig: Can't open configuration file /opt/glibc-2.14/etc/ld.so.conf: No such file or directory
Solution:
:/opt/glibc-2.14/etc$ sudo sh -c "echo '/usr/local/lib' >> ld.so.conf"
:/opt/glibc-2.14/etc$ sudo sh -c "echo '/opt/lib' >> ld.so.conf"

- 6,975
- 3
- 41
- 61
To update glibc please use the below command
yum -y update glibc

- 55,518
- 11
- 116
- 132

- 791
- 2
- 12
- 25
-
Why this answer got downvotes ? Isn't a pre-build version of the `glibc` that has been tested and confirmed to work on my Linux distro better ? – Accountant م Apr 18 '19 at 14:55
-
6@Accountantم CentOS 6 (even if OP upgraded to 6.10) has repositories that only go to 2.12. There is no `pre-build version of the glibc that has been tested` for 2.14 on this arch. Techie didn't read the question, that's why it's downvoted. Updating anything is as simple as `yum update`; there was a reason this scenario was more complicated and the question needed to be asked in the first place – Hashbrown May 09 '19 at 04:09
-
Instead of ```make install``` I did ```make install DESTDIR=/root/glibc-2.14/staging```. However, there is nothing in the stating directory and no error is displayed. – supmethods Oct 05 '22 at 06:29