记一次python2-certbot-nginx的艰难安装(rhel7/centos7)

第一次尝试:

[root@server1 html]# yum install -y python2-certbot-nginx
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel7.3                                                  | 4.1 kB     00:00     
No package python2-certbot-nginx available.
Error: Nothing to do

进入官网https://certbot.eff.org/lets-encrypt/centosrhel7-nginx,进行第二次尝试:

官网提示如下:

certbot打包在epel(EnterpriseLinux的额外包)中。要使用certbot,必须首先启用EPEL存储库。在RHEL或Oracle Linux上,还必须启用可选通道。

yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
yum install certbot python2-certbot-nginx

第三步报错,依然没有python2-certbot-nginx安装包

[root@server1 ~]# yum install certbot python2-certbot-nginx
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
No package certbot available.
No package python2-certbot-nginx available.

在网上查到需要epel-release安装包,然后进行第三次尝试:

[root@server1 html]# yum install epel-release
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
No package epel-release available.
Error: Nothing to do

在网上查找epel-release安装包,下载对应的版本,我下载的是epel-release-latest-7.noarch.rpm

wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm

继续第四次尝试:

[root@server1 ~]# yum install certbot python2-certbot-nginx
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:
.....
.....
.....
.....

失败原因:没有连接到Internet

修正错误,第五次尝试:

[root@server1 yum.repos.d]# yum install certbot python2-certbot-nginx
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
epel/x86_64/metalink                                     | 6.5 kB     00:00     
epel                                                     | 4.7 kB     00:00     
rhel7.3                                                  | 4.1 kB     00:00     
(1/3): epel/x86_64/group_gz                                |  88 kB   00:00     
(2/3): epel/x86_64/updateinfo                              | 995 kB   00:01     
(3/3): epel/x86_64/primary_db                              | 6.7 MB   00:10     
Resolving Dependencies
.....
.....
.....
Error: Package: 1:python-zope-component-4.1.0-5.el7.noarch (epel)
           Requires: python-zope-interface
Error: Package: python2-certbot-0.31.0-2.el7.noarch (epel)
           Requires: python-zope-interface

失败原因:系统提示需要python-zope-interface安装包

下载安装包,第五次尝试:

wget http://rpmfind.net/linux/centos/7.6.1810/os/x86_64/Packages/python-zope-interface-4.0.5-4.el7.x86_64.rpm
yum install -y python-zope-interface-4.0.5-4.el7.x86_64.rpm
yum install certbot python2-certbot-nginx

安装成功

你可能感兴趣的:(记一次python2-certbot-nginx的艰难安装(rhel7/centos7))