Score:3

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

jp flag

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

N0rbert avatar
zw flag
Do not upgrade libc because of single application, it is very dangerous action. How Stockfish was installed? What is its version? From which PPA/Flatpak/Appimage/Snap/tar?
jp flag
I get it from here: https://abrok.eu/stockfish/ It's the linux for modern computers + av2 version that always worked. I really, really depend on this I'm afraid -_-
guiverc avatar
cn flag
Does this answer your question? [Why don't the Ubuntu repositories have the latest versions of software?](https://askubuntu.com/questions/151283/why-dont-the-ubuntu-repositories-have-the-latest-versions-of-software)
N0rbert avatar
zw flag
Just curious what is your CPU model?
jp flag
@N0rbert it's an Intel Core i7-4710HQ
jp flag
@guiverc I sort of already knew about this, but I really depend on Stockfish running
llualpu avatar
ir flag
It has just happened to me today with Stockfish 15. Same problems. I'm also on Ubuntu 20.04 (the CPU is similar: Intel Core i7-6700HQ). I simply compiled the code and used the exe that was generated.
Score:3
zw flag

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
    
jp flag
Thank you! I went for the official 14.1 release and now it works :)
za flag
I found that the downloads page only linked to the latest version, whereas [the directory of files](https://stockfishchess.org/files/) lists all available. You can go back through the numbers until you find one that works on your system.
qwr avatar
kr flag
qwr
Stockfish 15 does not work on Ubuntu 20.04 glibc
ng flag
I wonder why would an author compile software meant for public use in a bleeding edge toolchain that's incompatible with current systems. One should always use the _oldest_ possible toolchain, so the binary it is compatible with a broader audience.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.