码迷,mamicode.com
首页 > 其他好文 > 详细

yum仓库 Nginx 安装不了错误

时间:2017-07-28 22:25:37      阅读:519      评论:0      收藏:0      [点我收藏+]

标签:yum   仓库   nginx   



今天在做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

贴图:

技术分享


以为是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=nginx repo  
    baseurl=http://nginx.org/packages/centos/$releasever/$basearch/  
    gpgcheck=0  
    enabled=1

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

技术分享于是出现下面错误

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


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

    [root@localhost ~]# yum list | grep nginx      nginx.i386                               1.4.7-1.el6.ngx               @nginx     
    nginx-debug.i386                         1.4.7-1.el6.ngx               nginx

会发现就是最新的稳定版

于是直接执行

    yum -y install nginx

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

技术分享

本文出自 “写个博客骗钱” 博客,请务必保留此出处http://dadonggg.blog.51cto.com/12672150/1951820

yum仓库 Nginx 安装不了错误

标签:yum   仓库   nginx   

原文地址:http://dadonggg.blog.51cto.com/12672150/1951820

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!