How to upgrade libc6 (glibc) beyond v 2.31 on Ubuntu 20.04?

I am using the Stockfish chess engine within some GUI, but yesterday it stopped working. I hadn't changed the engine, nor the interface, but when I tried to run the engine it "terminated with code...", but it didn't output any code. The only thing that could have changed is that I regularly upgrade my packages: sudo apt update && sudo apt dist-upgrade, and I guess that must have broke it. I installed the latest Stockfish Version and ran it in the command line, and the output it gives is:

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

So I wanted to upgrade GLIBC and I came upon this thread: [https://askubuntu.com/questions/736208/upgrading-glibc]: "Glibc (better known as GNU C Library) has a fork for linux which is called libc6. Libc6 is available via apt." I ran: apt-cache policy libc6, which gave the output:

libc6:
  Installed: 2.31-0ubuntu9.2
  Candidate: 2.31-0ubuntu9.2
  Version table:
 *** 2.31-0ubuntu9.2 500
        500 http://de.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.31-0ubuntu9 500
        500 http://de.archive.ubuntu.com/ubuntu focal/main amd64 Packages

Which tells me within the "normal" packages 2.31 is the official version for my OS version (Ubuntu 20.04).

So I tried doing it manually:How to install a libc6 version >= 2.29?

I downloaded libc6_2.34-0ubuntu3_amd64.deb from http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/, as described, but when I ran: sudo dpkg -i libc6_2.34-0ubuntu3_amd64.deb, it produced the following error:

dpkg: regarding libc6_2.34-0ubuntu3_amd64.deb containing libc6:amd64:
 libc6:amd64 breaks fakeroot (<< 1.25.3-1.1ubuntu2~)
  fakeroot (version 1.24-1) is present and installed.

dpkg: error processing archive libc6_2.34-0ubuntu3_amd64.deb (--install):
 installing libc6:amd64 would break fakeroot, and
 deconfiguration is not permitted (--auto-deconfigure might help)
Errors were encountered while processing:
 libc6_2.34-0ubuntu3_amd64.deb

How do I solve this? I am a bit of a newb, so preferably without breaking my system


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