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
Answer from Atur on askubuntu.com
🌐
Ask Ubuntu
askubuntu.com › questions › 1526185 › how-to-install-glibc-2-34-on-ubuntu-20-04
How to install GLIBC_2.34 on Ubuntu 20.04 - Ask Ubuntu
September 9, 2024 - There really is only one workaround for this that is 100% SAFE: Get a copy of virtualbox or some other thing that can run your software through virtualization extensions (lets guest OS talk to hardware directly to some degree) and install a small copy of your favorite GLIBC 2.34 OS operating system on that.
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.

Discussions

ubuntu - Error /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found - Stack Overflow
I needed this to install ghdl 3.0.0 on ubuntu 20.04 it seemed to do the trick. 2023-04-02T01:54:16.803Z+00:00 ... Confirm this works on WSL2 Ubuntu 20.04. Needed GLIBC 2.34+ for docker desktop. More on stackoverflow.com
🌐 stackoverflow.com
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
Glibc_2.34 ? - Kubuntu Forums
Trying to install an update to a program I have been running. I keep getting this error message...... /installer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./installer) What am I doing wrong? More on kubuntuforums.net
🌐 kubuntuforums.net
March 22, 2024
Problem when running on Ubuntu 20.04
I've had a similar problem. My solution was to build the app in a Ubuntu docker container and then copy the resulting binary from that container. The Dockerfile I've used looked like this: # Dockerfile for building a rust executable that can be run on a specific Ubuntu version (and newer) FROM ubuntu:20.04 RUN apt update && apt -y install curl build-essential RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y RUN ~/.cargo/bin/rustup update WORKDIR /rust/build/ COPY Cargo.toml Cargo.toml COPY Cargo.lock Cargo.lock # Docker will cache a step as long as there haven't been any changes to the files. # This will download and build all the dependencies and will re-run only when Cargo.toml/Cargo.lock will change RUN mkdir -p src/bin && echo "fn main() {}" > src/bin/docker_cache.rs && /bin/bash -c "source ${HOME}/.cargo/env && cargo build --release --bin docker_cache && exit 0" COPY . . RUN ["/bin/bash", "-c", "source ${HOME}/.cargo/env && cargo build --release"] # USAGE: # docker build -t tmp/ubuntu20:build # if [ $? == 0 ]; then # docker container create --name extract tmp/ubuntu20:build # docker container cp extract:/rust/build/target/release/EXECUTABLE_NAME ./ # docker container rm extract # fi Edit: reddit did terrible things to formatting, this will hopefully be fixed now More on reddit.com
🌐 r/rust
8
3
August 10, 2023
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.

🌐
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.
🌐
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.
Find elsewhere
🌐
Kubuntu Forums
kubuntuforums.net › forum › general › kubuntu-catchall › 677528-glibc_2-34
Glibc_2.34 ? - Kubuntu Forums
March 22, 2024 - /installer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./installer) What am I doing wrong? ... I'll Ask Jeeves...... ... What are you trying to install, exactly? Links? Ubuntu 22.04 has glibc 2.35 For some reason this thing wants an older version, which usually means it was built for older Linux versions.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › beginner questions
[SOLVED] `GLIBC_2.34' not found - Linux Mint Forums
November 8, 2022 - Kajojo wrote: ⤴Tue Nov 08, 2022 4:39 pm Tried to download glibc-source, it didn't work. glibc-source is in the universe repository, to install it run ... glibc-source is already the newest version (2.31-0ubuntu9.9). 2.31?? So I have to upgrade to 21 or something? ... Last edited by rickNS on Wed Nov 09, 2022 11:53 am, edited 1 time in total. Mint 21.0, and 22.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200 ... Your entire system depends on glibc so I'd recommend NOT messing with it. ... kajojo@kajojo:~$ java -version java: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (
🌐
Reddit
reddit.com › r/rust › problem when running on ubuntu 20.04
r/rust on Reddit: Problem when running on Ubuntu 20.04
August 10, 2023 -

When i tryed to run my app with Ubuntu 20.04, i got a error :

asbackup: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by asbackup)
asbackup: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by asbackup)
asbackup: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by asbackup)

I trying to find a web some guide, but i don't know how to fix this

Top answer
1 of 2
2
I've had a similar problem. My solution was to build the app in a Ubuntu docker container and then copy the resulting binary from that container. The Dockerfile I've used looked like this: # Dockerfile for building a rust executable that can be run on a specific Ubuntu version (and newer) FROM ubuntu:20.04 RUN apt update && apt -y install curl build-essential RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y RUN ~/.cargo/bin/rustup update WORKDIR /rust/build/ COPY Cargo.toml Cargo.toml COPY Cargo.lock Cargo.lock # Docker will cache a step as long as there haven't been any changes to the files. # This will download and build all the dependencies and will re-run only when Cargo.toml/Cargo.lock will change RUN mkdir -p src/bin && echo "fn main() {}" > src/bin/docker_cache.rs && /bin/bash -c "source ${HOME}/.cargo/env && cargo build --release --bin docker_cache && exit 0" COPY . . RUN ["/bin/bash", "-c", "source ${HOME}/.cargo/env && cargo build --release"] # USAGE: # docker build -t tmp/ubuntu20:build # if [ $? == 0 ]; then # docker container create --name extract tmp/ubuntu20:build # docker container cp extract:/rust/build/target/release/EXECUTABLE_NAME ./ # docker container rm extract # fi Edit: reddit did terrible things to formatting, this will hopefully be fixed now
2 of 2
1
Eugay is correct, but also want to add that instead of statically compiling with musl, you can also decide to maintain a "Ubuntu 20.04" version. To do so, just put your source code onto Ubuntu 20.04 and compile it there. The resulting binary will then be able to run on Ubuntu 20.04.
🌐
Ubuntu
launchpad.net › ubuntu › +source › glibc › 2.34-0ubuntu2
https://launchpad.net/ubuntu/+source/glibc/2.34-0u...
Ubuntu Developers · Architectures: any all · Section: libs · Urgency: Medium Urgency · Impish: amd64 arm64 armhf i386 ppc64el riscv64 s390x · diff from 2.33-0ubuntu9 to 2.34-0ubuntu2 (1.8 MiB) diff from 2.34-0ubuntu1 to 2.34-0ubuntu2 (5.3 KiB) View changes file · glibc-doc: No summary available for glibc-doc in ubuntu impish.
Top answer
1 of 2
3

It should be noted that https://abrok.eu/stockfish/ is not official, author clearly says that the packages were compiled with gcc 11.2/mingw 10 on Ubuntu 21.10.
While you are running 20.04 LTS which is older, so has older libc and other core system components.

I see two possible solutions:

  • Official packages from the developer

    The StockFish package for Ubuntu lists the following URL as developer's web-site https://stockfishchess.org . So you should visit https://stockfishchess.org/download/linux/ and then download relevant software distribution. For the time of writing it maybe done programmatically as follows:

    cd ~/Downloads
    wget -c https://stockfishchess.org/files/stockfish_14.1_linux_x64_avx2.zip
    unzip stockfish_14.1_linux_x64_avx2.zip
    cd stockfish_14.1_linux_x64_avx2
    chmod +x stockfish_14.1_linux_x64_avx2
    

    and then run it as ./stockfish_14.1_linux_x64_avx2.

    Note: it runs even on 18.04 LTS, does not complain about libc.

  • Some third-party PPA

    Finding PPA for StockFish is possible. It will end with for example StockFish 12.2 deb-package for 20.04 LTS, which may be installed by using below commands:

    sudo add-apt-repository ppa:savoury1/games
    sudo apt-get update
    sudo apt-get install stockfish
    

    Note: I'm not sure about AVX2 optimisation here.

    Reverting to default 11.1 version is possible by using below commands:

    sudo apt-get install ppa-purge
    sudo ppa-purge ppa:savoury1/games
    
2 of 2
0

I had the same issue with Stockfish 15 on Ubuntu 20.04. However it's not too difficult to compile from source following the directions at https://github.com/official-stockfish/Stockfish#compiling-stockfish-yourself-from-the-sources

cd src
make help

then check the latest arch supported, ex. grep bmi2 /proc/cpuinfo and make with the appropriate arch:

make net 
make build ARCH=x86-64-bmi2
🌐
DigitalOcean
digitalocean.com › community › questions › how-install-glibc-2-29-or-higher-in-ubuntu-18-04
How install GLIBC 2.29 or higher in Ubuntu 18.04 | DigitalOcean
June 6, 2020 - The first option is to migrate your application to a system that supports GLIBC higher than or equal to 2.29. This would mean a lot of work though. It seems Ubuntu 19.04 actually uses that version.
🌐
Reddit
reddit.com › r/linux4noobs › version `glibc_2.34' not found when using the command code
r/linux4noobs on Reddit: version `GLIBC_2.34' not found when using the command code
August 11, 2023 -

Hi, I have recently dualbooted my laptop so im still very much a linux noob and I installed VSCode with the ubuntu software app. When I try to open VSCode nothing happens, and if I use the code command I get the following error:

ERROR: ld.so: object '/usr/local/lib/x86_64-linux-gnu/libinput-config.so' from /etc/ld.so.preload cannot be preloaded (failed to map segment from shared object): ignored.

/snap/code/136/usr/share/code/bin/../code: /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /usr/local/lib/x86_64-linux-gnu/libinput-config.so)

Can someone please help me? I googled it but I can't find a solution. Thanks in advance

Edit:

Fixed it by using sudo vim on the /etc/ld.so.preload file and deleting the line /usr/local/lib/x86_64-linux-gnu/libinput-config.so.

🌐
OpenGenus
iq.opengenus.org › install-specific-version-of-glibc
Install specific version of Glibc
October 17, 2022 - This will install Glibc in the correct location.
🌐
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 ...