Skip to content

Instantly share code, notes, and snippets.

@zeroxia
Last active August 16, 2025 14:15
Show Gist options
  • Select an option

  • Save zeroxia/34ca7e4cba1b1368373c161434737c9e to your computer and use it in GitHub Desktop.

Select an option

Save zeroxia/34ca7e4cba1b1368373c161434737c9e to your computer and use it in GitHub Desktop.
Commands to install glibc 2.34 to Ubuntu 20.04 and patch latest neovim binary to run
## Prepare Ubuntu 20.04
sudo apt install build-essential
sudo apt install patchelf unzip bison gawk
## neovim prerelease:
https://github.com/neovim/neovim/releases
https://github.com/neovim/neovim/releases/tag/nightly
# e.g.,
cd ~/.local
https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz
tar xzf nvim-linux-x86_64.tar.gz
mkdir bin
cd bin
ln -s ../nvim-linux-x86_64/bin/nvim
# (Then add ~/.local/bin to PATH environment variable)
## Script for downloading and building, installing glibc-2.34 to ~/.local/glibc-2.34
#!/bin/bash
set -x
HERE=`pwd`
MY_VER=2.34
mkdir -p src glibc-${MY_VER}
cd src
wget http://ftp.gnu.org/gnu/libc/glibc-${MY_VER}.tar.gz
tar -xvzf glibc-${MY_VER}.tar.gz
rm -rf glibc-${MY_VER}-build
mkdir -p glibc-${MY_VER}-build
cd glibc-${MY_VER}-build
$HERE/src/glibc-${MY_VER}/configure --prefix=$HERE/glibc-${MY_VER}
make
make install
## Script for patching the binary:
#!/bin/bash
patchelf \
--set-interpreter ~/.local/glibc-2.34/lib/ld-linux-x86-64.so.2 \
--set-rpath ~/.local/glibc-2.34/lib:/lib/x86_64-linux-gnu \
~/.local/nvim-linux-x86_64/bin/nvim
patchelf --print-interpreter --print-rpath ~/.local/nvim-linux-x86_64/bin/nvim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment