大家好,我是后来,我会分享我在学习和工作中遇到的点滴,希望有机会我的某篇文章能够对你有所帮助,所有的文章都会在公众号首发,欢迎大家关注我的公众号" 后来X大数据 ",感谢你的支持与认可。

因为要在centos7 安装mysql8,在安装的时候遇到了这个鬼问题,头疼

# 安装mysql
rpm -ivh mysql-*.rpm[root@bigdata101 mysql-lib]# rpm -ivh mysql-community-client-8.0.19-1.el8.x86_64.rpm
warning: mysql-community-client-8.0.19-1.el8.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:libc.so.6(GLIBC_2.28)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libcrypto.so.1.1()(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libncurses.so.6()(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libssl.so.1.1()(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libssl.so.1.1(OPENSSL_1_1_0)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libssl.so.1.1(OPENSSL_1_1_1)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libstdc++.so.6(CXXABI_1.3.9)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libstdc++.so.6(GLIBCXX_3.4.20)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libstdc++.so.6(GLIBCXX_3.4.21)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64libtinfo.so.6()(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64mysql-community-libs(x86-64) >= 8.0.11 is needed by mysql-community-client-8.0.19-1.el8.x86_64

最后的问题发现:我太傻逼了,最后找到了问题的根源: 需要的是centos7 的mysql8,下的版本却是centos 8 的mysql 包,大家看看el后面的数字。和自己centos版本要一样啊。这问题太羞耻了。

但是下面的glibc 2.17升级2.28的内容还是可以的。

glibc 2.17升级2.28

# 查一下我的glibc版本:[root@bigdata101 glibc-2.28]# 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
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_PRIVATE

然后我就去官网下载了Glibc2.28打算安装,官网地址:http://ftp.gnu.org/gnu/glibc/(选择你想要的版本)

# 完整步骤:
tar -xf glibc-2.28.tar.gz
cd glibc-2.28
mkdir build; cd build../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin make
make install # 这一步的2个问题可以忽略ls -l /lib64/libc.so.6# 最后来看看我们的结果吧
strings /lib64/libc.so.6 | grep GLIBC
.....
GLIBC_2.26
GLIBC_2.27
GLIBC_2.28
GLIBC_PRIVATE

我的具体执行过程,以及报错修复

# 解压安装:
tar -xf glibc-2.28.tar.gz
cd glibc-2.28
mkdir build; cd build../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin  # 运行到这一步后就报错了,报错图如下图
# (如果这一步没报错的,大家可以直接往下翻,找到我继续安装glibc的过程)

事情并不顺利,它对应的gcc等版本也需要升级,所以就开始我的升级之路。以下截图是我glibc 2.28安装的报错

通过上面的报错,看到很多显示no和bad信息的都是版本不够

升级之前希望大家能打开INSTALL文件看一下,glibc建议大家安装的各插件版本 不要和我犯一样的错误,自以为是的安装了gcc新版本9.2.0,然而版本太新依然用不了还是报错。最后我还是安装了gcc8.2.0,安装步骤和下面的9.2.0是一样的

1. gcc版本不够,那就升级它,原来是4.8.5,给它升级到9.2.0

gcc -vUsing built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)yum -y install wget bzip2 gcc gcc-c++ glibc-headers# 下载gcc包到自己的目录,-P后面的下载目录自己指定
# 下载这个文件可以直接去官网下,反而更快一些,
# 下载地址:https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc(自己选择版本)
wget -c -P /opt/software/ https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.gz# 解压
cd /opt/software/
tar -zxvf gcc-9.2.0.tar.gz
# 解压要好久,可以喝杯茶放松一下cd gcc-9.2.0
./contrib/download_prerequisites    #下载gmp mpfr mpc等供编译需求的依赖项
# 结果如下:
2020-07-01 10:47:47 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 [2383840] -> "./gmp-6.1.0.tar.bz2" [1]
2020-07-01 10:48:26 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 [1279284] -> "./mpfr-3.1.4.tar.bz2" [1]
2020-07-01 10:48:41 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz [669925] -> "./mpc-1.0.3.tar.gz" [1]
2020-07-01 10:49:31 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 [1658291] -> "./isl-0.18.tar.bz2" [1]
gmp-6.1.0.tar.bz2: OK
mpfr-3.1.4.tar.bz2: OK
mpc-1.0.3.tar.gz: OK
isl-0.18.tar.bz2: OK
All prerequisites downloaded successfully.# 不能在source目录下configure,必须在上一层的目录下
mkdir build
cd bulid../configure --prefix=/usr/local/gcc-9.2.0 --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
# 结果如下
checking where to find the target ar... host tool
checking where to find the target as... host tool
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... host tool
checking where to find the target gcc... just compiled
checking where to find the target gfortran... host tool
checking where to find the target gccgo... host tool
checking where to find the target gdc... host tool
checking where to find the target ld... host tool
checking where to find the target lipo... host tool
checking where to find the target nm... host tool
checking where to find the target objcopy... host tool
checking where to find the target objdump... host tool
checking where to find the target otool... host tool
checking where to find the target ranlib... host tool
checking where to find the target readelf... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking where to find the target windmc... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile# 执行make,这个时间太长了,我大概用了不到4小时,我也不知道它在干啥,完全可以大家在中午吃饭前开始跑,或许午休后就可以了
make
# 结果:
make[4]: 离开目录“/opt/tmp/gcc-9.2.0/build/x86_64-pc-linux-gnu/libatomic”
make[3]: 离开目录“/opt/tmp/gcc-9.2.0/build/x86_64-pc-linux-gnu/libatomic”
make[2]: 离开目录“/opt/tmp/gcc-9.2.0/build/x86_64-pc-linux-gnu/libatomic”
make[1]: 离开目录“/opt/tmp/gcc-9.2.0/build”# 接下来安装它
make install
# 结果:
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/opt/software/gcc-9.2.0/build/x86_64-pc-linux-gnu/libatomic'
make[3]: Leaving directory `/opt/software/gcc-9.2.0/build/x86_64-pc-linux-gnu/libatomic'
make[2]: Leaving directory `/opt/software/gcc-9.2.0/build/x86_64-pc-linux-gnu/libatomic'
make[1]: Leaving directory `/opt/software/gcc-9.2.0/build'# 写配置文件
echo -e '\nexport PATH=/usr/local/gcc-9.2.0/bin:$PATH\n' >> /etc/profile.d/gcc.sh && source /etc/profile.d/gcc.sh# 导出头文件
ln -sv /usr/local/gcc-9.2.0/include/ /usr/include/gcc
# 结果:libgcc_s.so.1 -> libgcc_s-4.8.5-20150702.so.1libutil.so.1 -> libutil-2.17.so
/lib/sse2: (hwcap: 0x0000000004000000)
/lib64/sse2: (hwcap: 0x0000000004000000)
/lib64/tls: (hwcap: 0x8000000000000000)#配置生效
ldconfig -v
# 结果:# 导出验证
ldconfig -p |grep gcc
# 结果:
libgcc_s.so.1 (libc6,x86-64) => /lib64/libgcc_s.so.1# 查看版本
gcc -v
# 结果:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-9.2.0/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr/local/gcc-9.2.0 --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 9.2.0 (GCC)

2. GNU Make版本从3.82 升级到4.2.1

make -vGNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

make 官方下载地址:https://ftp.gnu.org/gnu/make/

# 解压
tar -zxvf make-4.2.1.tar.gz# 安装
cd make-4.2.1
# 建立编译目录
mkdir build
cd build
# 执行
../configure --prefix=/usr# 执行完,这里需要编译,会生成build.sh文件,然后执行这个文件
sh build.sh
# 然后安装
make install# 然后就安装完成了,查看版本
make -v
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

3. 安装bison

先看版本:

bison -V
bash: bison: command not foundbison -v
bash: bison: command not found

这就是没装啊,那就直接yum安装吧:

yum install -y bison


再来看看版本:

bison --version
bison (GNU Bison) 3.0.4
Written by Robert Corbett and Richard Stallman.Copyright (C) 2015 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.

好了,继续搞glibc走起

../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin


结果非常惊喜,没有报错啦。那就继续吧

make

结果又是一个报错,心态要奔了

./../include/libc-symbols.h:534:26: error: ‘__EI___errno_location’ specifies less restrictive attributes than its target ‘__errno_location’: ‘const’, ‘nothrow’ [-Werror=missing-attributes]534 |   extern __typeof (name) __EI_##name \|                          ^~~~~
./../include/libc-symbols.h:538:29: note: in expansion of macro ‘__hidden_ver1’538 | #  define hidden_def(name)  __hidden_ver1(__GI_##name, name, name);|                             ^~~~~~~~~~~~~
./../include/libc-symbols.h:602:32: note: in expansion of macro ‘hidden_def’602 | # define libc_hidden_def(name) hidden_def (name)|                                ^~~~~~~~~~
errno-loc.c:28:1: note: in expansion of macro ‘libc_hidden_def’28 | libc_hidden_def (__errno_location)| ^~~~~~~~~~~~~~~
errno-loc.c:24:1: note: ‘__EI___errno_location’ target declared here24 | __errno_location (void)| ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [../o-iterator.mk:9: /opt/module/mysql-lib/glibc-2.28/build/csu/errno-loc.os] Error 1
make[2]: Leaving directory '/opt/module/mysql-lib/glibc-2.28/csu'
make[1]: *** [Makefile:258: csu/subdir_lib] Error 2
make[1]: Leaving directory '/opt/module/mysql-lib/glibc-2.28'
make: *** [Makefile:9: all] Error 2

经过我又重装了gcc 8.2.0,这个问题终于消失了。

make install# 结果
LD_SO=ld-linux-x86-64.so.2 CC="gcc -B/usr/bin/" /usr/bin/perl scripts/test-installation.pl /opt/module/mysql-lib/glibc-2.28/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/module/mysql-lib/glibc-2.28'
make: *** [Makefile:12: install] Error 2# 这上面的问题可以忽略ls -l /lib64/libc.so.6# 最后来看看我们的结果吧
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
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
GLIBC_2.22
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_2.28
GLIBC_PRIVATE

glibc升级成功。

扫码关注公众号“后来X大数据”,回复【电子书】,领取超多本pdf 【java及大数据 电子书】

glibc 2.17升级2.28,gcc 4.8.5升级9.2.0,GNU Make 3.82 升级到4.2.1,安装bison相关推荐

  1. 【错误记录】TabLayout 升级支持库版本后报错 ( support:design 支持库升级到 28.0.0 后源码发生变更 )

    文章目录 一.报错信息 二.错误分析 三.修改方案 一.报错信息 之前开发 TabLayout 使用的是 com.android.support:design:25.3.1 支持库 , impleme ...

  2. android app targetsdk从23升级到28

    android app target sdk从23升级到28 一.23升级到24 1.隐式广播 2.权限更改 3.NDK 应用链接至平台库 二.24升级到26 1.后台服务 2.语言区域和国际化 3. ...

  3. linux升级之后黑屏,fedora升级到28之后gnome登录黑屏的解决方法

    在把fedora升级到28的过程中非常顺利,系统能正常启动,登录进入gnome3之后一直是黑屏状态,以下为解决方法. 使用dnf升级系统,命令是: sudo dnf upgrade --refresh ...

  4. jz2440 linux4,JZ2440 u-boot-2016.11、linux-4.17和busybox-1.28.4移植笔记

    2018年5月份开始在jz2440上陆续移植了u-boot-2016.11.u-boot-spl-2016.11. linux-4.17和busybox-1.28.4,其中linux-4.17和bus ...

  5. oracle修改10到20,Oracle 10.2.0.5 RMAN迁移并升级11.2.0.4一例

    一.环境介绍 1. 源数据库环境 操作系统版本: OEL 5.4 x64 数据库版本  : 10.2.0.5 x64 数据库sid名 : orcl Oracle 10g 10.2.0.5(64bit) ...

  6. ios15.0.1正式版耗电吗 ios15.0.1正式版值得升级吗

    最近,ios15.0.1正式更新了,而很多用户关心的是 ios15.0.1正式版的耗电情况,那么,ios15.0.1正式版耗电吗? ios15.0.1正式版值得升级吗?下面就一起来看看吧. ios15 ...

  7. Spring Boot 3.0 正式发布,这份升级指南必须收藏

    Spring Boot 3.0 现已正式发布,它包含了 12 个月以来 151 个开发者的 5700 多次代码提交.这是自 4.5 年前发布 2.0 以来,Spring Boot 的第一次重大修订. ...

  8. 狮子鱼社区团购小程序v17.8.0独立开源版+前端升级最新授权接口修复方法

    版本是播播资源网在新狮子鱼社区团购商城系统小程序v17.8.0独立版上优化,此系统拿来即用非常方便,优化很多细节如去掉一些后台无用的东西,比如后台连清个缓存功能也没有,首页美化,优化的细节其他就不一一 ...

  9. centos7升级openssh至openssh8.7.p1、openSSL至openssl3.0.3

    背景概要 OpenSSH(OpenBSD Secure Shell)是 Openbsd 计划组的一套用于安全访问远程计算机 的连接工具.该工具是 SSH 协议的开源实现,支持对所有的传输进行加密,可有 ...

最新文章

  1. 内部数据中心不会消失的6个原因
  2. C语言解决汉诺塔问题
  3. GOOGLE不让我访问啦?
  4. mybatis中sql语句传入多个参数方法
  5. python划分训练集和测试集_杨涛的Python机器学习3:单特征与多特征、训练集与测试集,杨桃...
  6. async python_Async Python 竟不比sync Python 快,怎么回事?
  7. discuz mysql配置文件_MySQL优化配置文件my.ini(discuz论坛)
  8. MarkDown 和LaTex语法学习(基于软件Typora)
  9. poj 1755 Triathlon (半平面交解一元二次不等式)(切割求半平面交)
  10. 使用jquery,按回车键实现tab键的功能
  11. ENVI App Store
  12. 002. 顺应自然,人才会活的好
  13. c语言trim库函数用法,c语言编写trim 函数
  14. mysql登录报错“Access denied for user ‘root‘@‘localhost‘ (using password: YES”的处理方法
  15. 警察犯人一家六口过河问题
  16. 计算机视觉中的算法幻想性视错觉
  17. 分布式作业调度框架——Elastic-Job
  18. qq飞车显示62目录服务器连接失败,[公告] QQ飞车游戏客户端无法登陆解决方法...
  19. 中级计算机证书有多少积分,中级会计资格证能积分多少
  20. 统计信号处理基础 习题解答1-3

热门文章

  1. 青少年机器人编程大赛用什么语言
  2. Python官网安装包下载慢
  3. 设置div高度等于屏幕高度
  4. 为什么说串行比并行快?
  5. Teardrop代码编程
  6. 安卓电子书格式_Kindle的一个劲敌,小米多看电子书入手体验
  7. 陌陌八成营收靠直播 直播行业已进入两极分化
  8. GGGGGGithub
  9. mysql中db的名词解释_数据库常用名词解释大全
  10. 用Altium Designer绘制stm32最小系统的电路原理图并完成STM32+SD卡 的系统原理图设计