I try to set new location for Glibc but LD_LIBRARY_PATH not working. I followed the first answer here:

How to update glibc to 2.14 in CentOS 6.5

And when I run the script at the end:

[taviad@cecentos ~]$ export LD_LIBRARY_PATH=/opt/glibc-2.14/lib
[taviad@cecentos ~]$ ldd --version
ldd (GNU libc) 2.12
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
Written by Roland McGrath and Ulrich Drepper.
  • 4
    You say you refer to solutions in the other question but everyone there says that it can not be done properly/safely. You'd have to really know what you're doing and that is obviously not the case. Note that this is only the beginning of your problems if you decide to continue. – Julie Pelletier Jan 1 '17 at 16:27
  • That could be similar to spending years to fit a bigger motor in a car to finally realize that the result is far from better and you lost all that time. – Julie Pelletier Jan 1 '17 at 16:31
  • 1
    Al least on my system, ldd is a bash script with the version string hardcoded in it, so it will never display anything other than that particular version. To check which glibc is being used, you can compile a small C program which ouputs the contents of gnu_get_libc_version, and see if it is different with LD_LIBRARY_PATH set. But this being said, I agree with the advice from the other comments: unless you really, really know what you're doing, don't mess with your glibc version manually. – brm Jan 1 '17 at 17:59
  • I must use this version to compile my code, I have no other option. – tomer Jan 2 '17 at 14:43

You must fire the commands separately. One for declaration and another for exporting.



It will work flawlessly but during the current login session. In order to make it permanent. You must export in any .sh file kept under /etc/profile.d/ There are a lot more ways to export but this is the most suited.

  • No need to export on a separate line in modern shells. Also, ~/.bash_profile may be a better place for this. – Kusalananda May 15 '17 at 9:25
  • agreed. another nice option. – Neeraj Sharma May 15 '17 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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