在centos7上由于openssl的版本低导致的错
在centos 7 执行这个命令报的错:
yum -y install bison bison-devel zlib-devel libcurl-devel \
libarchive-devel boost-devel ncurses-devel gnutls-devel \
libxml2-devel openssl-devel libevent-devel libaio-devel
Error: Package: 1:openssl-devel-1.0.2k-19.el7.x86_64 (base)
Requires: openssl-libs(x86-64) = 1:1.0.2k-19.el7
Installed: 1:openssl-libs-1.0.2k-21.el7_9.x86_64 (@updates)
openssl-libs(x86-64) = 1:1.0.2k-21.el7_9
Available: 1:openssl-libs-1.0.2k-19.el7.x86_64 (base)
openssl-libs(x86-64) = 1:1.0.2k-19.el7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
1.为解决这个问题,下载相关的rpm包,以x86_64为例,下载相对应的版本 openssl 和 openssl-libs,其他版本自行去 rpm search中心搜索,下载到本地
wget ftp://ftp.pbone.net/mirror/ftp.centos.org/7.9.2009/updates/x86_64/Packages/openssl-libs-1.0.2k-21.el7_9.x86_64.rpm
然后安装
yum localinstall openssl-libs-1.0.2k-21.el7_9.x86_64.rpm
2.如果 localinstall 有错,检查是否二者的版本一致,若匹配,则执行如下命令尝试
yum list | grep openssl-libs
rpm -ivh --replacefiles openssl-libs-1.0.2k-21.el7_9.x86_64.rpm --force
或者用这个命令
yum update openssl
yum update openssl-libs
3.然后用这个命令看一下版本,如果匹配就对了
[root@centos7 ~]#rpm -qi openssl-libs
Name : openssl-libs
Epoch : 1
Version : 1.0.2k
Release : 21.el7_9
Architecture: x86_64
Install Date: Sat 15 May 2021 07:18:00 PM CST
Group : System Environment/Libraries
Size : 3208300
License : OpenSSL
Signature : RSA/SHA256, Fri 18 Dec 2020 04:35:15 AM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : openssl-1.0.2k-21.el7_9.src.rpm
Build Date : Thu 17 Dec 2020 05:25:27 AM CST
Build Host : x86-01.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://www.openssl.org/
Summary : A general purpose cryptography library with TLS implementation
Description :
OpenSSL is a toolkit for supporting cryptography. The openssl-libs
package contains the libraries that are used by various applications which
support cryptographic algorithms and protocols.
4.再次执行命令
yum -y install bison bison-devel zlib-devel libcurl-devel \
libarchive-devel boost-devel ncurses-devel gnutls-devel \
libxml2-devel openssl-devel libevent-devel libaio-devel
还是报一样的错
5.下载 openssl-devel
用迅雷下载
http://rpm.pbone.net/resultsb_dist_94_size_1581144_name_openssl-devel-1.0.2k-21.el7_9.x86_64.rpm.html
传到虚拟机里面
6.rpm安装
[root@centos7 ~]#rpm -ivh openssl-devel-1.0.2k-21.el7_9.x86_64.rpm --force
error: Failed dependencies:
krb5-devel(x86-64) is needed by openssl-devel-1:1.0.2k-21.el7_9.x86_64
zlib-devel(x86-64) is needed by openssl-devel-1:1.0.2k-21.el7_9.x86_64
先安装依赖
yum -y install krb5-devel zlib-devel
再次安装 就不报错了
[root@centos7 ~]#rpm -ivh openssl-devel-1.0.2k-21.el7_9.x86_64.rpm --force
Preparing... ################################# [100%]
Updating / installing...
1:openssl-devel-1:1.0.2k-21.el7_9 ################################# [100%]
7.再次执行命令就不报错了
yum -y install bison bison-devel zlib-devel libcurl-devel \
libarchive-devel boost-devel ncurses-devel gnutls-devel \
libxml2-devel openssl-devel libevent-devel libaio-devel