Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save carlesloriente/ab3387e7d035ed400dc2816873e9089e to your computer and use it in GitHub Desktop.
Save carlesloriente/ab3387e7d035ed400dc2816873e9089e to your computer and use it in GitHub Desktop.
Compile and install GLIBC 2.18 in CentOS 7
# Check gist comments to verify system PATH and or adapt it.
wget https://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxvf glibc-2.18.tar.gz
cd glibc-2.18
mkdir build
cd build
../configure --prefix=/opt/glibc-2.18
make -j4
sudo make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/glibc-2.18/lib
@Georodin
Copy link

how to undo? I have now critical errors with almost every command

@lshiwjx
Copy link

lshiwjx commented Aug 26, 2020

how to undo? I have now critical errors with almost every command

have you solved it? I meet the same problem. @Georodin

@shafishcn
Copy link

Seems to be a problem with LD_LIBRARY_PATH

@jeijei4
Copy link

jeijei4 commented Feb 23, 2021

how to undo? I have now critical errors with almost every command

have you solved it? I meet the same problem. @Georodin

I solved it like this:

  1. Find what the variable has stored $LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH

Example result:

/usr/local/lib:/usr/local/lib64:/opt/glibc-2.18
  1. Remove the following:
:/opt/glibc-2.18

It would look like this (for example):

/usr/local/lib:/usr/local/lib64
  1. Save it to variable $LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64

@crazytaxii
Copy link

the source url is ineffective, replace it with https://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz

@pengzhendong
Copy link

Can I update it without root?

@rambo-panda
Copy link

rambo-panda commented Mar 8, 2023

ubuntu20.4如何将glibc2.31升级到2.32?

Brooooooklyn/canvas#370


It is more straightforward to replace centos7 (after all, centos7 is really old)

@rambo-panda
Copy link

Can I update it without root?

Be sure to use root

@carlesloriente
Copy link
Author

Thank you, @crazytaxii for pointing the URL change.

@mthiagu
Copy link

mthiagu commented Sep 6, 2023

how to undo? I have now critical errors with almost every command

have you solved it? I meet the same problem. @Georodin

I solved it like this:

  1. Find what the variable has stored $LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH

Example result:

/usr/local/lib:/usr/local/lib64:/opt/glibc-2.18
  1. Remove the following:
:/opt/glibc-2.18

It would look like this (for example):

/usr/local/lib:/usr/local/lib64
  1. Save it to variable $LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64

If all commands fails after adding new glibc in LD_LIBRARY_PATH, simply try
unset $LD_LIBRARY_PATH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment