CentOS 6.9 升级 glibc 2.12 到 2.17(qbit)

前言

  • 当前日期是 2022.7.6,CentOS 6 停止维护更新日期是 2020.11.30,CentOS 6 已停止维护近两年
  • 由于种种原因,qbit 需要在 CentOS 6.9 上通过 Miniconda 安装 Python 3.8,发现 glibc 版本太旧装不上,于是试验升级了glibc
  • 初始环境

    CentOS 6.9 x86_64
    glibc 2.12

步骤

  • 直接安装 MiniConda3 报错

    $ sh Miniconda3-py38_4.12.0-Linux-x86_64.sh 
    WARNING:
      The installer is not compatible with the version of the Linux distribution
      installed on your system. The version of GLIBC is no longer supported.
      Found version 2.12, which is less than 2.17
    Aborting installation.
    
  • 查看当前 glibc 版本

    $ ldd --version
    ldd (GNU libc) 2.12
    Copyright (C) 2010 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    由 Roland McGrath 和 Ulrich Drepper 编写。
  • 切换软件仓库(centos-vault源)

     curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
  • 生成缓存

    yum makecache
  • github 上的脚本升级 glibc,脚本内容如下

    #!/bin/bash
    
    # update glibc to 2.17 for CentOS 6
    
    GLIBC=glibc
    OS=el6
    SERVER=https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6
    VERSION=2.17-55
    FULL_VERSION=$GLIBC-$VERSION.fc20
    X64=x86_64
    I386=i386
    I636=i686
    REPO_32=epel-6-$I386
    REPO_64=epel-6-$X64
    
    SERVER_32=$SERVER/$REPO_32/$FULL_VERSION
    RPM_32=$VERSION.$OS.$I636.rpm
    SERVER_64=$SERVER/$REPO_64/$FULL_VERSION
    RPM_64=$VERSION.$OS.$X64.rpm
    
    # Packages
    P_1=$GLIBC
    P_2=$GLIBC-common
    P_3=$GLIBC-devel
    P_4=$GLIBC-headers
    P_5=$GLIBC-static
    P_6=$GLIBC-utils
    P_7=nscd
    
    # Required as dependency of glibc-utils
    sudo yum install --assumeyes gd
    
    # 64-bit
    sudo rpm -Uvh --force $SERVER_64/$P_1-$RPM_64 $SERVER_64/$P_2-$RPM_64 $SERVER_64/$P_3-$RPM_64 $SERVER_64/$P_4-$RPM_64 $SERVER_64/$P_5-$RPM_64 $SERVER_64/$P_6-$RPM_64 $SERVER_64/$P_7-$RPM_64
    # Print out versions
    strings /lib64/libc.so.6 | grep GLIBC
  • 再次检查当前 glibc 版本(不用重启)

    $ ldd --version
    ldd (GNU libc) 2.17
    Copyright (C) 2012 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Roland McGrath and Ulrich Drepper.
  • 正常安装 Miniconda3

    $ sh Miniconda3-py38_4.12.0-Linux-x86_64.sh 
    
    Welcome to Miniconda3 py38_4.12.0
    
    In order to continue the installation process, please review the license
    agreement.
    Please, press ENTER to continue
    >>> 
本文出自qbit snap

你可能感兴趣的:(CentOS 6.9 升级 glibc 2.12 到 2.17(qbit))