[root@asimov ~]#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 ID 7bd9bf62: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:nginx-release-centos-7-0.el7.ngx ################################# [100%]
[root@asimov ~]#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
问题1: Requires: libcrypto.so.10(OPENSSL_1.0.2)(64bit)
解决:
##查看yum 源
[root@asimov /etc/yum.repos.d]#vim nginx.repo
# nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
##找这个包libcrypto.so.10
[root@asimov ~]#find / -name libcrypto.so.10
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/lib64/libcrypto.so.10 ##有这个东西
[root@asimov ~]#openssl version ##查看openssl版本
OpenSSL 1.0.2o 27 Mar 2018
[root@asimov ~]#rpm -q --provides openssl
openssl = 1:1.0.1e-60.el7
openssl(x86-64) = 1:1.0.1e-60.el7
##查看当前库文件中的 libcrypto.so.10
[root@asimov ~]#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)
##升级OpenSSL 1.0.2
http://rpmfind.net/linux/rpm2html/search.php?query=libcrypto.so.10(OPENSSL_1.0.2)(64bit)&submit=Search+…&system=&arch=
##右下角
[root@asimov /home/kiosk/repod]#rpm -ivh openssl-libs-1.0.2k-16.el7.x86_64.rpm
问题:和之前版本的冲突
file /usr/lib64/openssl/engines/libubsec.so from install of openssl-libs-1:1.0.2k-16.el7.x86_64 conflicts with file from package openssl-libs-1:1.0.1e-60.el7.x86_64
解决:强制安装(最好别强制安装,实在不行就强制安装)
[root@asimov /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%]
##继续用yum 安装
[root@asimov ~]#yum install nginx
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/home/kiosk/anaconda3/envs/python36/lib/liblzma.so.5:
version `XZ_5.1.2alpha' not found (required by /lib64/librpmio.so.3)
问题:liblzma.so.5找不到’xz_5.1.2alpha’版本
[root@asimov ~]#rpm -q --provides openssl ##rpm貌似也用不了了
rpm: /home/kiosk/anaconda3/envs/python36/lib/liblzma.so.5:
version `XZ_5.1.2alpha' not found (required by /lib64/librpmio.so.3)
[root@asimov ~]#find / -name liblzma.so.5
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/lib64/liblzma.so.5
/home/kiosk/anaconda3/pkgs/xz-5.2.4-h14c3975_4/lib/liblzma.so.5
/home/kiosk/anaconda3/lib/liblzma.so.5
/home/kiosk/anaconda3/envs/python3/lib/liblzma.so.5
/home/kiosk/anaconda3/envs/python36/lib/liblzma.so.5
/home/kiosk/anaconda3/envs/flask/lib/liblzma.so.5
/home/kiosk/anaconda3/envs/Scrapy/lib/liblzma.so.5
/home/kiosk/anaconda3/envs/Django/lib/liblzma.so.5
解决:
https://www.cnblogs.com/Lee-yl/p/9748699.html
可能原因是 librpmio.so.3 需要 XZ_5.1.2alpha 在lzma共享库中定义符号的库。liblzma.so.5.2.2定义此符号,但liblzma.so.5.2.3、liblzma.so.5.2.4等版本不定义。
[root@asimov ~]#find / -name liblzma.so.5.2.2
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/lib64/liblzma.so.5.2.2
##所以说liblzma.so.5这个库需要liblzma.so.5.2.2定义此符号,然后把liblzma.so.5.2.2软链接/liblzma.so.5库下
[root@asimov ~]#ln -s -f /usr/lib64/liblzma.so.5.2.2
/home/kiosk/anaconda3/envs/python36/lib/liblzma.so.5
[root@asimov ~]#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.
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.16.0-1.el7.ngx will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
nginx x86_64 1:1.16.0-1.el7.ngx nginx 766 k
Transaction Summary
================================================================================
Install 1 Package
..........................
----------------------------------------------------------------------
Verifying : 1:nginx-1.16.0-1.el7.ngx.x86_64 1/1
Installed:
nginx.x86_64 1:1.16.0-1.el7.ngx
[root@asimov ~]#rpm --help ##rpm也可以用了
Usage: rpm [OPTION...]
Query/Verify package selection options:
-a, --all query/verify all packages
-f, --file query/verify package(s) owning file