I want to install Android NDK on my CentOS 6.5 machine. But when I ran the program, it says it needs glibc 2.14 to be able to run. My CentOS 6.5 only has Glibc 2.12 installed. So I tried to update glibc by:

$ sudo yum update glibc

But after that I found the glibc version is still 2.12, not 2.14.

$ ldd --version
ldd (GNU libc) 2.12

I think glibc 2.14 may not be available on CentOS repositories. So how can I update it to glibc 2.14 on CentOS 6.5?

  • 2
    It's easier to upgrade to CentOS7 which contains GLibC 2.14 than it is to upgrade GLibC from 2.12 to 2.14. See Skype Call Recorder – eyoung100 Dec 29 '14 at 20:34
  • @eyoung100 I still need CentOS 6.5 rather than 7. Is there an easy way to upgrade Glibc to 2.14? Thx! – tonga Dec 29 '14 at 20:45
  • 3
    No, see one of my other answers for why. – eyoung100 Dec 29 '14 at 20:51
  • Based on your answers, it seems that the best solution will be either upgrading to CentOS 7 or using an older version of NDK which requires glibc 2.12. Thanks for your comments. – tonga Dec 29 '14 at 21:01
  • 1
    You could also install a CentOS7 chroot to run the NDK in. – derobert Dec 29 '14 at 21:23

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${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
  • 2
    Want to mention, that builing process takes 2.5 hours on slow AWS. Maybe useful for someone the next info: instruction above fixes psycopg2 issue ImportError: /lib/libc.so.6: version 'GLIBC_2.14' (I use Centos 6.5 and PostgreSQL v 9.6) – TitanFighter Nov 8 '16 at 2:54
  • 1
    Brilliant answer! I followed this answer exactly and it worked like a charm. Thank you – thonnor Sep 21 '17 at 15:28
  • 1
    Can also be used for later versions; simply change "2.14" to "2.23" or whatever version you need, as highlighted by things like: /usr/local/lib/somlelib.so: undefined reference to 'somefunction@GLIBC_2.23' (the last few digits are the version). To make the compile faster, use make -j8 if you have 8 threads on your cpu etc. Mine completed in few minutes. – Roel Feb 19 '18 at 9:09
  • I'm left with relocation error: libc.so.6: symbol _dl_find_dso_for_object, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference after the export phase (when trying any command). Can anyone help? @Roel – belka Mar 24 '18 at 7:00
  • 1
    Thanks man, worked as expected on CENTOS 6.10. I replaced this line sudo make install with make install while I was root, because my user was not in the sudoers file – Accountant م Apr 16 at 20:51

To install glibc 2.14 in parallel, add the configure prefix:

tar zxvf glibc-2.14.tar.gz
cd glibc-2.14
mkdir build
cd build
../configure --prefix=/opt/glibc-2.14
make -j4
make install

Following this process, you'll be able to build 2.14 but you will need to tell the compiler where to look for glibc.

Below are the ways you can expose the glibc to your program.

  1. LD_LIBRARY_PATH=/opt/glibc-2.14/lib

    export LD_LIBRARY_PATH.

    The library is exposed during your current login session.

  2. You can permanently link your new glibc version like so, but please read the WARNING below:

    ln -sf /opt/glibc-2.14/glibc-2.14.so /lib/libc.so.6.

Since libc.so.6 is just a symbolic link. Executing the above command will make the link point towards the new glibc library. However this step is not recommended since there are many programs in Linux which depend on older versions and will stop working.

  • +1 for the details of exposing the library – Accountant م Apr 16 at 20:57

Common alternative technique. Installing GLIBC 2.14 in parallel (Intall it to the /opt directory) Then it is available to the programs which require it without breaking your core OS.

  • 6
    How would you do this? Download an rpm and ? – rncrtr Jun 22 '15 at 19:58

protected by Community Jan 31 '17 at 8:49

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.