How can I point ldd to pick up my latest compiled Glibc library?

Invoke the ldd from the directory you built: /opt/glibc-2.39/bin/ldd.

Your next question is likely going to be: "I've set LD_LIBRARY_PATH=/opt/glibc-2.39/lib64, but my application crashes with SIGSEGV (or doesn't run for another reason)".

If so, see this answer.

Answer from Employed Russian on Stack Overflow
🌐
Reddit
reddit.com › r/linux4noobs › running into a version `glibc_2.38' not found error
r/linux4noobs on Reddit: Running into a version `GLIBC_2.38' not found error
April 7, 2024 -

What the title says. I'm trying to run a program, and even after installing its dependencies (sdl2, freetype, harfbuzz, onnxruntime, darling) and restarting the system (I know most of the time it doesn't need, but just in case) it keeps saying the same issue.

/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found

What I've seen after searching for a bit is that either I have to build the program myself, or use a different version of linux. I MIGHT be ok, since I was planning to make a new installation when Kubuntu 24.04 releases eventually (I mean, it WILL release, right???) but I really want to give this a try beforehand.

Running a Kubuntu 22.04 distro that updated itself from a 20.04 one. Hardware is full amd and decent enough? I don't think it affects this issue in specific.

Discussions

How to upgrade Glibc library in Ubuntu 22.04 - Stack Overflow
I am currently running a Ubuntu 22.04 VM. It has by default Glibc 2.35. Due to a security vulnerability, I am trying to upgrade it to 2.39. I followed the following steps to download the gzipped bi... More on stackoverflow.com
🌐 stackoverflow.com
Failing to install Poetry - GLIBC 2.38 not found - ubuntu-latest (24.04 as of 9th Jan 2025)
EDIT: I've changed the title of this issue to reflect the things that I have discovered in my investigations in the comments below. This was working fine in my workflow last night, and today it's f... More on github.com
🌐 github.com
10
January 9, 2025
How to install GLIBC 2.29 or higher in Ubuntu 18.04 - Stack Overflow
So I am trying to install truDesk on my local system. I am getting this error while running the command npm install -g yarn: node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found ( More on stackoverflow.com
🌐 stackoverflow.com
How do I update GLIBC?
Your best bet would probably be to run do-release-upgrade to upgrade to Ubuntu 24.04. It probably not feasible to upgrade just glibc because it's a dependency of basically everything. More on reddit.com
🌐 r/Ubuntu
13
2
July 24, 2025
🌐
Ubuntu
launchpad.net › ubuntu › +source › glibc › 2.38-1ubuntu4
2.38-1ubuntu4 : glibc package : Ubuntu
This package contains the sources and patches which are needed to build glibc.
Top answer
1 of 2
6

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
2 of 2
0

Introducing glibc will break your core binaries. Updated core binaries require a newer kernel which breaks hardware drivers (like NVIDIA) that need your old kernel. This "vicious cycle" makes it impossible to use new glibc w/o breaking your system.

The only solution is to compile the unsupported drivers somehow for the new kernel. So far this is not possible.

If you try using GLIBC without updating its dependencies, you will get complaints of a version mismatch on its dependencies which go all the way down to the kernel, which is why it is not possible.

Your options are limited and it is not possible unless you use a virtual machine. But likely VM is not what you want because VMs do not have the advantage of talking to your hardware directly. They have some VM extensions for making that better but they only cover CPU and RAM, not the video/sound card, that is all emulated.

Summary

If you want to run something that needs newer hardware, there is just no way around that:

  1. You cant use unsupported hardware on newer kernel, and therefore linker, and then GLIBC.

  2. You can't use unsupported GLIBC on older kernel which relies on the new kernel features. If you try to do it by force (point to new compiled version of the new binaries) you will get an error that the linker/kernel versions are incorrect.

  3. The only solution to this is if there was a way to update your hardware drivers. If that isn't your problem, then UPGRADE UBUNTU to the latest version. If that IS your problem, then you are out of luck.

  4. Companies like NVIDIA and AMD drop video support after a few years and leave you up a creek with no paddle, stranded on an old OS unless you buy yet another video card (even if your current one is fast and does just fine, they do NOT care).

  5. Sandboxing in flatpak still needs those libraries to be able to link with your kernel. Sandboxing only fixes dependencies that are above the base system level. HOWEVER, if any of those libraries were built against a binaries that recursively rely on newer core libraries, you will still be stuck and it will still not work, below is an example:

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
(required by /tmp/.mount_my2newapp.a9fz3/usr/bin/../../usr/lib/liblzma.so.5)

As you can see here, even though the appimage/flatpak/snap was sandboxed, it still needed these new libraries further down the dependency chain.

🌐
Linuxier
linuxier.com › how-to-install-glibc-on-ubuntu
How to Install GLIBC on Ubuntu [22 Simple Steps] - Linuxier
May 12, 2024 - To install GLIBC on Ubuntu, start by opening your terminal and checking your current version with lsb_release -a. Next, install essential building tools using sudo apt-get install build-essential.
🌐
Puppy Linux Discussion Forum
forum.puppylinux.com › board index › puppy linux main › house training › users help
How to update to glibc 2.38? - Puppy Linux Discussion Forum
Like Oscar says, you cannot risk trying to do an install while running in the very same Puppy.....for the simple reason that you risk changing the very dependencies you need for the installer tools to function and complete their task. I'm not entirely sure quite how battleshooter - one very clever lass! - constructed her glibc-2.20 upgrade for Saluki/Carolina.
🌐
GitHub
github.com › snok › install-poetry › issues › 163
Failing to install Poetry - GLIBC 2.38 not found - ubuntu-latest (24.04 as of 9th Jan 2025) · Issue #163 · snok/install-poetry
January 9, 2025 - jobs: build: runs-on: ubuntu-latest container: node:latest timeout-minutes: 15 permissions: id-token: write contents: read checks: write steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.11 - name: Update package list run: apt-get update - name: Install system dependencies run: apt-get install -y python3-dev libpq-dev - name: Install Poetry uses: snok/install-poetry@v1
Author   snok
Find elsewhere
🌐
TecMint
tecmint.com › home › linux commands › how to install and run multiple glibc libraries in linux
How to Install and Run Multiple glibc Libraries in Linux
June 13, 2024 - cd glibc-2.38 mkdir build cd build ../configure --prefix=/usr/local/glibc-2.38 make -j4 sudo make install
🌐
Its Linux FOSS
itslinuxfoss.com › home › ubuntu › how to install glibc on ubuntu 22.04
How to Install glibc on Ubuntu 22.04 – Its Linux FOSS
September 26, 2022 - Ubuntu 22.04 users can install “glibc” package by executing the command “sudo apt install glibc-source”. The “glibc” is a C library that supports GNU and Linux-based systems.
🌐
Ubuntu
packages.ubuntu.com › glibc
Ubuntu – Package Search Results -- glibc
August 10, 2021 - You have searched for packages that names contain glibc in all suites, all sections, and all architectures. Found 4 matching packages. jammy (22.04LTS) (doc): GNU C Library: Documentation 2.35-0ubuntu3.13 [security]: all
Top answer
1 of 2
29

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

2 of 2
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.

🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › software & applications
/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found - Linux Mint Forums
February 20, 2024 - /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found I went to the location /lib/x86_64-linux-gnu and libm.so.6 is not found OK, how do I add that which is missing??? Generally speaking, you can't. Glibc is a library that the entire operating system and almost all packages depend ...
🌐
Reddit
reddit.com › r/ubuntu › how do i update glibc?
r/Ubuntu on Reddit: How do I update GLIBC?
July 24, 2025 -

I’m currently using GLIBC 2.35 on Ubuntu 22.04, and I want to update it (for gaming purposes).

I’m also aware that updating it isn’t as simple as typing:

“sudo apt update GLIBC yada yada”

or whatever, so I’m not entirely sure how to update it properly without bricking my install.

Any ideas on what to do?

🌐
Ubuntu
launchpad.net › ubuntu › +source › glibc
glibc package in Ubuntu
GLibC 2.42 is older than the current packaged version. Launchpad may be missing release information for the head series or this package is linked to the wrong GLibC series. ... Other versions of 'glibc' in untrusted archives. The following unsupported and untrusted Personal Archives (PPAs) provide packages of 'glibc': GCC x86-64-v2 owned by PPA for Ubuntu ...
🌐
Reddit
reddit.com › r/debian › how do i get a newer version of glibc? (2.38 or above?)
r/debian on Reddit: How do i get a newer version of glibc? (2.38 or above?)
June 9, 2024 -

Basically im trying to run a game but it requires at least glibc 2.38 but it seems debian only offers 2.36 at the moment. Any way i can get a newer vesion of it?

EDIT: ended up just downloading the windows version of the game and running it with wine, im an idiot and thought i was having a problem with the sound when i first downloaded, that's why i tried the linux binary, but when i ran it with wine again i found out that the game came muted by default and that i had to press + to get the volume up

🌐
Linux Mint Forums
forums.linuxmint.com › board index › chat › chat about linux mint
Has anyone made any attempt to upgrade glibc? - Linux Mint Forums
January 27, 2024 - Theoretically, at next boot, "ldd --version" would say "2.38", programs requiring "libc.so.6" 2.38 would work, and programs requiring "libc.so.6" 2.35 would still work because "libc.so.6" 2.35 is still there, and/or because "libc.so.6" 2.38 offers an ascending compatibility. I have a need for a newer glibc and I tried your suggestion. I compiled/installed glibc-2.38 and created extralibs.conf with the correct path /opt/glibc-2.38 (dash missing in your message) but ldd --version still returns version 2.35 at next boot.
🌐
Ubuntu
launchpad.net › ubuntu › +source › glibc › 2.38-1ubuntu6.2
glibc 2.38-1ubuntu6.2 source package in Ubuntu - Launchpad
This package contains the precompiled locale data for all supported locales. A better alternative is to install the locales package and only select desired locales, but it can be useful on a low-memory machine because some locale files take a lot of memory to be compiled.