基于CentOS上安装ScyllaDB数据库的朋友应该都会遇到glibc必须为2.28及以上版本的问题,哈目前阿里去上提供的最高版本CentOS7.6中的glibc版本为2.27,所以必须要升级,但升级glibc并不是一件容易的事,如果操作不当还会影响一些API和服务的正常运行,所以在升级之前请先做好备份。


升级前的准备工作:1、升级gcc到9.2.0(请参考我的另一遍博文[https://yq.aliyun.com/articles/718551?spm=a2c4e.11155435.0.0.47163312EbbvoU](《》))2、安装Python3.8.03、升级GNU Make 3.82到4.2.1wget http://ftp.gnu.org/gnu/make/make-4.2.1.tar.gztar -zxvf make-4.2.1.tar.gzcd make-4.2.1mkdir buildcd build../configure --prefix=/opt/make && make && make installexport PATH=/opt/make/bin:$PAThln -s /opt/make/bin/make /opt/make/bin/gmakemake -v
root@xxx-xxxx ~ # cat /etc/redhat-release    # 查看当前linux版本信息
CentOS Linux release 7.6.1810 (Core) root@xxx-xxxx ~ # strings /lib64/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
......
......
posix_spawnp@GLIBC_2.2.5
getrpcent_r@@GLIBC_2.2.5
getprotobynumber_r@@GLIBC_2.2.5
_IO_file_close_it@@GLIBC_2.2.5
_obstack@GLIBC_2.2.5root@xxx-xxxx ~ #  wget -c -P /opt/tmp/ http://ftp.gnu.org/gnu/glibc/glibc-2.30.tar.gz
--2019-09-18 11:39:49--  http://ftp.gnu.org/gnu/glibc/glibc-2.30.tar.gz
正在解析主机 ftp.gnu.org (ftp.gnu.org)... 209.51.188.20, 2001:470:142:3::b
正在连接 ftp.gnu.org (ftp.gnu.org)|209.51.188.20|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:32664968 (31M) [application/x-gzip]
正在保存至: “glibc-2.30.tar.gz”100%[===========================================================================>] 32,664,968   116KB/s 用时 19m 34s2019-09-18 11:59:24 (27.2 KB/s) - 已保存 “glibc-2.30.tar.gz” [32664968/32664968])root@xxx-xxxx ~ # cd /opt/tmp/
root@xxx-xxxx /opt/tmp # tar -zxvf glibc-2.30.tar.gz    # 解压缩源码包
glibc-2.30/
glibc-2.30/.gitattributes
glibc-2.30/.gitignore
glibc-2.30/COPYING
glibc-2.30/COPYING.LIB
glibc-2.30/ChangeLog
glibc-2.30/ChangeLog.old/
glibc-2.30/ChangeLog.old/ChangeLog.1
glibc-2.30/ChangeLog.old/ChangeLog.10
glibc-2.30/ChangeLog.old/ChangeLog.11
......
......
glibc-2.30/wctype/wcfuncs_l.c
glibc-2.30/wctype/wchar-lookup.h
glibc-2.30/wctype/wctrans.c
glibc-2.30/wctype/wctrans_l.c
glibc-2.30/wctype/wctype.c
glibc-2.30/wctype/wctype.h
glibc-2.30/wctype/wctype_l.croot@xxx-xxxx /opt/tmp # cd glibc-2.30
root@xxx-xxxx /opt/tmp/glibc-2.30 # mkdir build
root@xxx-xxxx /opt/tmp/glibc-2.30 # cd build
root@xxx-xxxx /opt/tmp/glibc-2.30/build # ../configure  --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for readelf... readelf
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ can link programs... yes
checking for sysdeps preconfigure fragments... aarch64 alpha arm csky hppa i386 m68k microblaze mips nios2 powerpc riscv s390 sh sparc x86_64 checking whether gcc compiles in -mx32 mode by default... nochecking for use of fpu sysdeps directories... yes
checking for -fstack-protector... yes
checking for -fstack-protector-strong... yes
checking for -fstack-protector-all... yes
checking for assembler and linker STT_GNU_IFUNC support... yes
checking for gcc attribute ifunc support... yes
checking whether the linker supports textrels along with ifunc... yes
checking if compiler warns about alias for function with incompatible types... yes
checking sysdep dirs... sysdeps/unix/sysv/linux/x86_64/64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86 sysdeps/x86/nptl sysdeps/unix/sysv/linux/wordsize-64 sysdeps/x86_64/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/x86_64 sysdeps/unix sysdeps/posix sysdeps/x86_64/64 sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86/fpu sysdeps/x86_64/multiarch sysdeps/x86_64 sysdeps/x86 sysdeps/ieee754/float128 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/wordsize-64 sysdeps/ieee754 sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether /usr/bin/as is GNU as... yes
checking whether /usr/bin/ld is GNU ld... yes
checking for /usr/bin/as... /usr/bin/as
checking version of /usr/bin/as... 2.27, ok
checking for /usr/bin/ld... /usr/bin/ld
checking version of /usr/bin/ld... 2.27, ok
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 4.2.1, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.19.8.1, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 5.1, ok
checking for sed... sed
checking version of sed... 4.2.2, ok
checking for gawk... gawk
checking version of gawk... 4.0.2, ok
checking for bison... bison
checking version of bison... 3.0.4, ok
checking if gcc -B/usr/bin/ is sufficient to build libc... yes
checking for nm... nm
checking for python3... python3
checking version of python3... 3.8.0, ok
checking LD_LIBRARY_PATH variable... ok
checking for bash... /usr/bin/bash
checking for perl... /usr/bin/perl
checking for install-info... /usr/sbin/install-info
checking for .set assembler directive... yes
checking linker support for protected data symbol... yes
checking linker support for INSERT in linker script... yes
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking whether to use .ctors/.dtors header and trailer... no
checking for libunwind-support in compiler... no
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for linker that supports -z execstack... yes
checking for linker that supports --no-dynamic-linker... yes
checking for -static-pie... yes
checking for -fpie... yes
checking for --hash-style option... yes
checking for sufficient default -shared layout... no
checking for GLOB_DAT reloc... yes
checking linker output format... elf64-x86-64
checking for -fno-toplevel-reorder -fno-section-anchors... yes
checking for -mtls-dialect=gnu2... yes
checking whether cc puts quotes around section names... no
checking for __builtin_memset... yes
checking for redirection of built-in functions... yes
checking for compiler option to disable generation of FMA instructions... -ffp-contract=off
checking if gcc -B/usr/bin/ accepts -fno-tree-loop-distribute-patterns with __attribute__ ((__optimize__))... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... yes
checking for audit_log_user_avc_message in -laudit... no
checking for cap_init in -lcap... no
checking for _FORTIFY_SOURCE predefine... no
checking whether the linker provides working __ehdr_start... yes
checking for __builtin_trap with no external dependencies... yes
checking whether the C++ compiler supports thread_local... no
running configure fragment for sysdeps/unix/sysv/linux/x86_64/64
running configure fragment for sysdeps/unix/sysv/linux/x86_64
running configure fragment for sysdeps/unix/sysv/linux
checking installed Linux kernel header files... 3.2.0 or later
checking for kernel header at least 3.2.0... ok
checking for symlinks in /usr/include... ok
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/x86_64
checking for AVX512DQ support in assembler... yes
checking for AVX512 support... yes
checking -mprefer-vector-width=128... yes
checking for Intel MPX support... yes
running configure fragment for sysdeps/x86
checking whether -fPIC is default... no
checking whether -fPIE is default... no
configure: creating ./config.status
config.status: creating config.make
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default commands
# 如果支行没有错误会生成makefile,如果有错按照错误提示解决,一般都是一些依赖项目的版本不正确升级一下即可root@xxx-xxxx /opt/tmp/glibc-2.30/build # make
make -r PARALLELMFLAGS="" -C .. objdir=`pwd` all
make[1]: Entering directory '/opt/tmp/glibc-2.30'
......
......
make[2]: Leaving directory '/opt/tmp/glibc-2.30/elf'
make[1]: Leaving directory '/opt/tmp/glibc-2.30'    # 编译成功root@xxx-xxxx /opt/tmp/glibc-2.30/build # make install
LC_ALL=C; export LC_ALL; \
make -r PARALLELMFLAGS="" -C .. objdir=`pwd` install
make[1]: Entering directory '/opt/tmp/glibc-2.30'
make  subdir=csu -C csu ..=../ subdir_lib
make  subdir=iconv -C iconv ..=../ subdir_lib
......
......
LD_SO=ld-linux-x86-64.so.2 CC="gcc -B/usr/bin/" /usr/bin/perl scripts/test-installation.pl /opt/tmp/glibc-2.30/build/
/usr/bin/ld: cannot find -lnss_test2
collect2: error: ld returned 1 exit status   # 此编译错误可以无视
Execution of gcc -B/usr/bin/ failed!         # 此编译错误可以无视
The script has found some problems with your installation!
Please read the FAQ and the README file and check the following:
- Did you change the gcc specs file (necessary after upgrading fromLinux libc5)?
- Are there any symbolic links of the form libXXX.so to old libraries?Links like libm.so -> libm.so.5 (where libm.so.5 is an old library) are wrong,libm.so should point to the newly installed glibc file - and there should beonly one such link (check e.g. /lib and /usr/lib)
You should restart this script from your build directory after you've
fixed all problems!
Btw. the script doesn't work if you're installing GNU libc not as your
primary library!
make[1]: *** [Makefile:111: install] Error 1
make[1]: Leaving directory '/opt/tmp/glibc-2.30'
make: *** [Makefile:12: install] Error 2    # 此编译错误可以无视root@xxx-xxxx /opt/tmp/glibc-2.30/build # ls -l /lib64/libc.so.6    # 检验是否成功
lrwxrwxrwx 1 root root 12 Sep 18 15:14 /lib64/libc.so.6 -> libc-2.30.so    # 表示安装成功root@xxx-xxxx ~ #

以上内容来自我的云栖社区:https://yq.aliyun.com/articles/718698?spm=a2c4e.11155435.0.0.780b33120vqnKg

CentOS 7.6 编译安装最新版本glibc2.30 实录相关推荐

  1. ubuntu安装python_ubuntu18.04下源码编译安装最新版本Python3

    原文链接:ubuntu18.04下源码编译安装最新版本Python3 截止到2019年4月9日,Python3最新的版本是3.7.3. 在ubuntu18.04中已经安装的Python3版本是3.6. ...

  2. python版本升级后编译_ubuntu18.04下源码编译安装最新版本Python3

    截止到2019年4月9日,Python3最新的版本是3.7.3. 在ubuntu18.04中已经安装的Python3版本是3.6.7,下面我们就演示一下如何在ubuntu18.04下源码编译安装Pyt ...

  3. 手把手教你如何在 Linux 上源码安装最新版本 R

    如果你使用的 Linux 系统 GCC 版本太低,又没有 root 权限(即使有 root 权限又担心升级 GCC 带来的风险):同时你又不想额外多安装多一个 Anaconda 或者 Minicond ...

  4. CentOS 7安装最新版本NMAP

    nmap是一款非常实用的扫描工具,适用于linux.windows.mac三大主流平台. 直接yum安装nmap # yum install nmap Loaded plugins: fastestm ...

  5. centos 6.2 编译安装mysql_CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13

    CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13 2013-10-24 15:31:12 标签:服务器 防火墙 file 配置文件 written 一.配置 ...

  6. CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13+博客系统WordPress3.3.2

    说明: 操作系统:CentOS 6.2 32位 系统安装教程:CentOS 6.2安装(超级详细图解教程): http://www.osyunwei.com/archives/1537.html 准备 ...

  7. Centos7 下定义MariaDB源Yum安装最新版本的MariaDB

    Centos7 下定义MariaDB源Yum安装最新版本的MariaDB 在Centos下安装软件服务的方式一般就那么几种(yum.rpm ivh xxx.make make&&ins ...

  8. CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13

    CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13 2013-10-24 15:31:12 标签:服务器 防火墙 file 配置文件 written 一.配置 ...

  9. centos mysql proxy_在Centos 5.2下安装最新的MySQL Proxy

    mysql proxy的代码树已经迁移到lauchpad,采用bazaar进行版本管理.参考了一些文档,在CentOS 5.2下编译安装最新mysql proxy成功.步骤记录如下(在centos 5 ...

最新文章

  1. java/jsp/sql server项目 字符编码统一_JSP开发过程遇到的中文乱码问题及解决方案...
  2. C 语言编程 — 高级数据类型 — 指针
  3. 工作214:结构 vue操作一个很有意思的报错 [Vue warn]: You may have an infinite update loop in a component
  4. 路由cpu负载过高检查
  5. [机器学习]TF-IDF是什么
  6. 实时“头发-面部皮肤”分割与人脸肤色分类
  7. Ubuntu 18.04 上使用 OpenJDK 安装并运行 Tomcat
  8. 适合MySQL master/slave模式的JDBC driver: lbpool
  9. Delphi XE7下如何创建一个Android模拟器调试?
  10. MyBatis 拦截器执行顺序
  11. pycharm双击打不开,无响应,下列第二种方法我亲测有效
  12. heka 0.11.0源码分析--主要启动流程分析
  13. 成都有哪些牛批的互联网公司?
  14. 服务器和售票系统,网上售票系统的开发与实现.doc
  15. [心情]享受堕落的乐趣
  16. Nodejs 中的非阻塞I/O、异步和事件驱动
  17. R语言使用matrix函数创建空矩阵、使用nrow参数和ncol参数指定矩阵的行列数
  18. 基于WIFI定位的室内定位系统--WIFI室内定位--新导智能
  19. 【人工智能】未来三年(2018-2020),我们在新一代人工智能产业能做什么
  20. Oracle给查询结果从1到n添加序号

热门文章

  1. 马上就博士毕业了,博士毕业论文外审结果回来了
  2. jvm参数调优_3_问题排查
  3. day18_雷神_django第一天
  4. 雾里看菊:热点IP是怎么生成的
  5. “马里奥(Mario)之父”──宫本茂
  6. html鼠标悬停超链接(头像、文字)显示提示信息
  7. np.arange()函数
  8. 罗克韦尔PLC编程软件ControlLogix平台
  9. 安卓手机真的不行了,搞不定卡顿问题,只能抄袭苹果iOS系统,然而各怀鬼胎的它们终究画虎不成反类犬...
  10. 微信开放平台开发常见错误(长期更新)