当我已经有 glibc2.31 时如何安装 glibc 2.32

当我已经有 glibc2.31 时如何安装 glibc 2.32

请帮我安装glibc2.32。运行 20.04。

答案1

如果您需要 ubuntu 附带版本以外的 glibc 版本,一种方法是手动安装到您的临时位置$HOME。(如果出现问题,安装/usr会弄乱现有的 glibc)

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

现在你应该已经在安装目录中安装了 glibc 2.32,请检查~/glibc/glibc-2.32 install/bin/ldd --version

答案2

构建于沙利尼的回答是,

#!/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

您可以使用类似这样的脚本bash script-name.sh bison 3.8下载bison版本号为的 GNU 3.8

相关内容