Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have debian bulleye. Can you write me a bash script that will download and compile different glibc versions and put them on different folders? I want to be able to runn programs made for different versions using patchelf --set-interpreter . I don't want to change anything on my system. I just want to have different versions of glibc in different folders. Please, selecte the most important versions that will cover most of old and new programs.
- ---------
- Sure! Here's a bash script that will download and compile glibc versions 2.13, 2.17, 2.23, 2.27, 2.31, and 2.33, and place them in different folders:
- ```bash
- #!/bin/bash
- # Create directories for each glibc version
- mkdir glibc-2.13 glibc-2.17 glibc-2.23 glibc-2.27 glibc-2.31 glibc-2.33
- # Download and extract glibc versions
- wget https://ftp.gnu.org/gnu/glibc/glibc-2.13.tar.gz
- tar -xzvf glibc-2.13.tar.gz -C glibc-2.13 --strip-components=1
- wget https://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
- tar -xzvf glibc-2.17.tar.gz -C glibc-2.17 --strip-components=1
- wget https://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz
- tar -xzvf glibc-2.23.tar.gz -C glibc-2.23 --strip-components=1
- wget https://ftp.gnu.org/gnu/glibc/glibc-2.27.tar.gz
- tar -xzvf glibc-2.27.tar.gz -C glibc-2.27 --strip-components=1
- wget https://ftp.gnu.org/gnu/glibc/glibc-2.31.tar.gz
- tar -xzvf glibc-2.31.tar.gz -C glibc-2.31 --strip-components=1
- wget https://ftp.gnu.org/gnu/glibc/glibc-2.33.tar.gz
- tar -xzvf glibc-2.33.tar.gz -C glibc-2.33 --strip-components=1
- # Compile each glibc version
- for dir in glibc-2.13 glibc-2.17 glibc-2.23 glibc-2.27 glibc-2.31 glibc-2.33; do
- (
- cd $dir
- mkdir build
- cd build
- ../configure --prefix=$PWD/install
- make -j$(nproc)
- make install
- )
- done
- ```bash
- This script will download the specified glibc versions, extract them, compile them, and install them in separate directories. You can then use patchelf to set the interpreter path when running programs with different glibc versions.
- Remember to give execute permission to the script using chmod +x script.sh and run it using ./script.sh from the terminal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement