12

Please help me install glibc 2.32. Running 20.04.

Neo
  • 165
  • 7
    Not a good idea. The libraries shipped by glibc have a lot of reverse dependencies, and an upgrade would probably trigger a need to rebuild quite a few other packages. So if a later glibc is important for some reason, the best option you have is to upgrade to 20.10 and then 21.04. – Gunnar Hjalmarsson Jun 12 '21 at 02:12

2 Answers2

28

If you need glibc version other than the one shipped with ubuntu, one way is to install manually to a temp location in your $HOME. (installing in /usr would mess up with existing glibc in case something goes wrong)

mkdir $HOME/glibc/ && cd $HOME/glibc
wget http://ftp.gnu.org/gnu/libc/glibc-2.32.tar.gz
tar -xvzf glibc-2.32.tar.gz
mkdir build 
mkdir glibc-2.32-install
cd build
~/glibc/glibc-2.32/configure --prefix=$HOME/glibc/glibc-2.32-install
make
make install

Now you should have glibc 2.32 installed in the installation directory. You may check with ~/glibc/glibc-2.32-install/bin/ldd --version

  • 3
    These are awesome steps, thank you! I was able to successfully build GLIBC_2.33. I basically replaced 2.32 with 2.33 in your steps, worked perfectly. I hit one bison missing error, resolved by install bison, followed these steps: https://stackoverflow.com/questions/7320370/installation-of-flex-and-bison-in-ubuntu – Ashley Jan 14 '23 at 08:35
  • 2
    I was following the instructions in Ubuntu 20.04, and the system had missing gawk so I had to install it. – ssi-anik Mar 14 '23 at 10:03
  • In my case, bison was missing, so I had to install. – TonyParker Feb 13 '24 at 09:41
  • My version of make was too old. I followed these instructions to update it, then I had to fix the gmake symlink to point to the new version at /usr/local/bin/make, and then I could install glibc as above. – aidandeno Mar 28 '24 at 07:52
  • 1
    I succeeded this, but if I do ldd --version it is still 2.31 – Yan King Yin May 04 '24 at 17:39
1

Building on Shalini's answer,

#!/bin/bash

SOFTWARE_NAME=$1 SOFTWARE_VERSION=$2

export DOWNLOAD_INSTALL_DIR=$SOFTWARE_NAME-$SOFTWARE_VERSION-download-install if [ -f $DOWNLOAD_INSTALL_DIR ]; then rm -fr $DOWNLOAD_INSTALL_DIR echo "Remove $DOWNLOAD_INSTALL_DIR" fi

mkdir $HOME/$DOWNLOAD_INSTALL_DIR/ && cd $HOME/$DOWNLOAD_INSTALL_DIR

echo "Current directory at $PWD"

export DOWNLOADED_TAR=$HOME/$DOWNLOAD_INSTALL_DIR/$SOFTWARE_NAME-$SOFTWARE_VERSION.tar.gz if [ ! -f $DOWNLOADED_TAR ]; then wget https://ftp.gnu.org/gnu/$SOFTWARE_NAME/$SOFTWARE_NAME-$SOFTWARE_VERSION.tar.gz -P $HOME/$DOWNLOAD_INSTALL_DIR echo "Software is downloaded: $SOFTWARE_NAME, version = $SOFTWARE_VERSION " else echo "Software is ALREADY downloaded: $SOFTWARE_NAME, version = $SOFTWARE_VERSION at $DOWNLOADED_TAR" fi tar -xvzf $DOWNLOADED_TAR -C $HOME/$DOWNLOAD_INSTALL_DIR mkdir $HOME/$DOWNLOAD_INSTALL_DIR/build export SOURCE_DIR=$HOME/$DOWNLOAD_INSTALL_DIR/$SOFTWARE_NAME-$SOFTWARE_VERSION-install mkdir $SOURCE_DIR cd $HOME/$DOWNLOAD_INSTALL_DIR/build ~/$DOWNLOAD_INSTALL_DIR/$SOFTWARE_NAME-$SOFTWARE_VERSION/configure --prefix=$SOURCE_DIR make make install

export SOFTWARE_PATH=$HOME/$DOWNLOAD_INSTALL_DIR/$SOFTWARE_NAME-$SOFTWARE_VERSION-install/bin/$SOFTWARE_NAME if [ -f $SOFTWARE_PATH ]; then echo "Software is found: $SOFTWARE_NAME, version = $SOFTWARE_VERSION at $SOFTWARE_PATH" mv $SOFTWARE_PATH $GRAND_ROOT_BIN fi

You can use the script like so bash script-name.sh bison 3.8 for downloading GNU's bison with version number 3.8.

Jim
  • 111