12

I'd like to update to a 2022 version of glibc, at least 2.35. This seems to be available on Ubuntu 22.04, but how can I get it on 20.04?

Jack M
  • 1,310
  • 2
  • 16
  • 32
  • 2
    the problem is that glibc is a system package, and a lot of things can break if you install the wrong version. what do you need it for? – Esther May 11 '22 at 21:12
  • @Esther I want those sexy new cutting-edge printf features. (It's not very important, but some code I wrote on a newer machine doesn't run on this one because it uses this feature which I didn't realize was new). – Jack M May 11 '22 at 21:21
  • 5
    https://stackoverflow.com/a/44710599/12642499 you can't replace the one you have, because many built-in binaries depend on it. But you can install the newer version from source in some other location, and patch your programs to use glibc from a non-default location. choosing a location for the install happens when you run ./compile --prefix=/path/to/new/glibc in the source directory, you can pass it a flag prefix which will tell it where to install, and then make to compile and install glibc there. – Esther May 11 '22 at 21:47
  • 1
    Export the LD_LIBRARY PATH environment variable to point to the location of a newer lib. – MarkHu May 31 '22 at 02:19
  • @MarkHu, pardon my ignorance, with PATH you mean the path-to-glibc-new-install/bin directory from https://askubuntu.com/a/1345783/123217? – ssi-anik Mar 14 '23 at 10:27
  • For me, glibc-2.35 on Ubuntu-20.04 crashes with Segmentation Fault, whether built from source or extracted from a newer-release .deb.

    $ env LD_LIBRARY_PATH=/home/me/Downloads/Build/glibc-2.35/glibc-build /bin/ls -F

    Segmentation fault (core dumped)

    – Randall Whitman Oct 31 '23 at 22:53

1 Answers1

4

You can use following commands to bring in newer version of glibc in ubuntu 20.04, but note that as it is a system package, upgrading it may impact your system.

apt-get install gawk bison gcc make wget tar -y
wget -c https://ftp.gnu.org/gnu/glibc/glibc-2.35.tar.gz
tar -zxvf glibc-2.35.tar.gz && cd glibc-2.35
mkdir glibc-build && cd glibc-build
../configure --prefix=/opt/glibc
make
make install
Atur
  • 249