加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

yum仓库 Nginx 安装不了错误

发布时间:2020-12-15 16:37:21 所属栏目:安全 来源:网络整理
导读:今天在做yum仓库的时候,安装Nginx,出现下列错误: -- Finished Dependency Resolution Error: Package: nginx-1.10.2-1.el6.x86_64 (epel) Requires: libpcre.so.0()(64bit) Error: Package: nginx-mod-http-perl-1.10.2-1.el6.x86_64 (epel) Requires: pe



今天在做yum仓库的时候,安装Nginx,出现下列错误:


--> Finished Dependency Resolution

Error: Package: nginx-1.10.2-1.el6.x86_64 (epel)

Requires: libpcre.so.0()(64bit)

Error: Package: nginx-mod-http-perl-1.10.2-1.el6.x86_64 (epel)

Requires: perl(:MODULE_COMPAT_5.10.1)

You could try using --skip-broken to work around the problem

You could try running: rpm -Va --nofiles --nodigest

贴图:

wKiom1l7G7vQiUopAABXcmDc5M8904.png


以为是yum源出现了错误,于是使用下面命令更改了下yum源。


将yum源仓库移动到另外一个备份文件中

mv /etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup

将外国的yum源地址改为国内阿里yum源仓库,提高访问速度。

wget -O/etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

mv /etc/yum.repos.d/epel.repo/etc/yum.repos.d/epel.repo.backup

mv /etc/yum.repos.d/epel-testing.repo/etc/yum.repos.d/epel-testing.repo.backup

wget -O/etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo


修改完yum源后再次执行 yum install -y nginx ,结果还是一样的错误!


下面借鉴网络上的解决方法,结果解决了:

1.创建一个文件 /etc/yum.repos.d/nginx.repo,并将下面的内容复制进去:

[nginx]
name=nginxrepo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

在编辑这个文件时,没有对齐

wKiom1l7HVjg89QbAAAi3LBvEmo085.png

于是出现下面错误

wKioL1l7HY7y_c9cAAA_iQnTiVY979.png

于是重新将配置文件中[nginx]下面的语句左对齐后,再次使用yum list列出所有可安装的软件包后正常了。


2.编辑并保存/etc/yum.repos.d/nginx.repo文件后,在命令行下执行

[root@localhost~]#yumlist|grepnginxnginx.i3861.4.7-1.el6.ngx@nginx
nginx-debug.i3861.4.7-1.el6.ngxnginx

会发现就是最新的稳定版

于是直接执行

yum-yinstallnginx

再次安装Nginx后就正常了,出现了我们最喜欢的安装完成界面了。

wKioL1l7Hk2DQxvCAAArvJCOiSg842.png

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读