1.首先下載nginx的網(wǎng)絡(luò)源
[root@localhost ~]# rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
Retrieving http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
warning: /var/tmp/rpm-tmp.JkMpgZ: Header V4 RSA/SHA1 Signature, key ID7bd9bf62: NOKEY
Preparing...################################# [100%]
Updating / installing...
1:nginx-release-centos-7-0.el7.ngx #################################[100%]
2.使用yum安裝nginx
[root@localhost ~]# yum install nginx
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
: manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
code | 2.9 kB 00:00
docker-ce-stable | 3.5 kB 00:00
google-chrome | 1.3 kB 00:00
nginx | 2.9 kB 00:00
file:///mnt/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/repodata/repomd.xml"
Trying other mirror.
(1/4): google-chrome/primary | 1.7 kB 00:00
(2/4): docker-ce-stable/x86_64/primary_db | 28 kB 00:00
(3/4): code/primary_db | 89 kB 00:00
(4/4): nginx/x86_64/primary_db | 46 kB 00:02
google-chrome 3/3
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.16.0-1.el7.ngx will be installed
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: 1:nginx-1.16.0-1.el7.ngx.x86_64
--> Finished Dependency Resolution
Error: Package: 1:nginx-1.16.0-1.el7.ngx.x86_64 (nginx)
Requires: libcrypto.so.10(OPENSSL_1.0.2)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
3.此時(shí)我們看到如下報(bào)錯(cuò)惊搏,說(shuō)缺少libcrypto.so.10這個(gè)包
Error: Package: 1:nginx-1.16.0-1.el7.ngx.x86_64 (nginx)
Requires: libcrypto.so.10(OPENSSL_1.0.2)(64bit)
4.但經(jīng)過(guò)查詢巾遭,其實(shí)是有這個(gè)包的
[root@localhost ~]# find / -name libcrypto.so.10
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/lib64/libcrypto.so.10 ##是有這個(gè)東西
[root@localhost ~]# openssl version ##查看openssl版本
OpenSSL 1.0.2o 27 Mar 2018
[root@localhost ~]# rpm -q --provides openssl
openssl = 1:1.0.1e-60.el7
openssl(x86-64) = 1:1.0.1e-60.el7
5.查看當(dāng)前庫(kù)文件中的 libcrypto.so.10
[root@localhost ~]# rpm -q --provides openssl-libs | grep libcrypto.so.10
libcrypto.so.10()(64bit)
libcrypto.so.10(OPENSSL_1.0.1)(64bit)
libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit)##libcrypto.so.10(OPENSSL_1.0.2)(64bit)
libcrypto.so.10(libcrypto.so.10)(64bit)
6.把升級(jí)OpenSSL 1.0.1到OpenSSL 1.0.2
在右下角找到并下載
| CentOS 7.7.1908 for x86_64 | openssl-libs-1.0.2k-19.el7.x86_64.rpm |
上傳到服務(wù)器后,使用rpm進(jìn)行升級(jí)疹鳄,為了防止和已經(jīng)有的版本沖突快压,強(qiáng)制安裝(--force)
[root@ /home/kiosk/repod]# rpm -ivh openssl-libs-1.0.2k-16.el7.x86_64.rpm --force
warning: openssl-libs-1.0.2k-16.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:openssl-libs-1:1.0.2k-16.el7 ################################# [100%]
現(xiàn)在用yum安裝nginx,發(fā)現(xiàn)已經(jīng)可以正常安裝了