教程:CentOS 6 更新glibc到2.15 / OpenVZ

2018年2月13日 4 条评论 432 次阅读 1 人点赞

背景

狗博主一直喜欢用CentOS 6(就像很多人不习惯其他操作平台一样),最近又剁了几个OVZ小鸡,想着给他装GOOGLE BBR的时候,却发现glibc还停留在2.13,这里我知道的有两种更新方式,推荐使用第一种,会比较快。

OpenVZ 更新glibc到2.15

方法一:rpm安装

先下载以下几个文件:

wget http://ftp.redsleeve.org/pub/steam/glibc-2.15-60.el6.x86_64.rpm \
http://ftp.redsleeve.org/pub/steam/glibc-common-2.15-60.el6.x86_64.rpm \
http://ftp.redsleeve.org/pub/steam/glibc-devel-2.15-60.el6.x86_64.rpm \
http://ftp.redsleeve.org/pub/steam/glibc-headers-2.15-60.el6.x86_64.rpm \
http://ftp.redsleeve.org/pub/steam/nscd-2.15-60.el6.x86_64.rpm

然后安装

rpm -Uvh glibc-2.15-60.el6.x86_64.rpm \
glibc-common-2.15-60.el6.x86_64.rpm \
glibc-devel-2.15-60.el6.x86_64.rpm \
glibc-headers-2.15-60.el6.x86_64.rpm \
nscd-2.15-60.el6.x86_64.rpm

方法二:编译安装(上面的方式行不通,再用编译的方式,编译的方式相对时长会久很多)

wget http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.gz
wget http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz
tar -zxf glibc-2.15.tar.gz
tar -zxf glibc-ports-2.15.tar.gz
mv glibc-ports-2.15 glibc-2.15/ports
mkdir glibc-build-2.15
cd glibc-build-2.15
../glibc-2.15/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make all && make install

检查是否成功安装

ldd --version

成功安装的输入如下

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.

成功安装完成后就可以愉快的安装bbr了,可以参考我这里的一键bbr脚本:
https://www.sabia.cc/bash-openvz-bbr-lkl-nanqinlang.html

Joker

这个人太懒什么东西都没留下

文章评论(4)

  • yunnan0317

    救活了我的vps :biggrin:

    2018年5月1日
    • Joker

      @yunnan0317 能帮到你简直太好了!

      2018年5月2日
  • wayne

    请问当我更新glbic输入
    rpm -Uvh glibc-2.15-60.el6.x86_64.rpm \
    glibc-common-2.15-60.el6.x86_64.rpm \
    glibc-devel-2.15-60.el6.x86_64.rpm \
    glibc-headers-2.15-60.el6.x86_64.rpm \
    nscd-2.15-60.el6.x86_64.rpm
    之后,系统提示:
    # rpm -Uvh glibc-2.15-60.el6.x86_64.rpm glibc-common-2.15-60.el6.x86_64.rpm glibc-devel-2.15-60.el6.x86_64.rpm glibc-headers-2.15-60.el6.x86_64.rpm nscd-2.15-60.el6.x86_64.rpm
    error: Failed dependencies:
    kernel-headers is needed by glibc-headers-2.15-60.el6.x86_64
    kernel-headers >= 2.2.1 is needed by glibc-headers-2.15-60.el6.x86_64
    glibc-common = 2.12-1.149.el6_6.4 is needed by (installed) glibc-2.12-1.149.el6_6.4.i686
    Exit code: 5
    *** End of transmission ***

    安装失败了

    2018年6月6日
    • Joker

      @wayne 用另一个方式安装即可。

      2018年6月7日