天天看點

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

貼圖:

<a href="https://s4.51cto.com/wyfs02/M02/9D/31/wKiom1l7G7vQiUopAABXcmDc5M8904.png" target="_blank"></a>

以為是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

修改完yum源後再次執行  yum install -y nginx   ,結果還是一樣的錯誤!

下面借鑒網絡上的解決方法,結果解決了:

1.建立一個檔案 /etc/yum.repos.d/nginx.repo,并将下面的内容複制進去:

<a href="http://blog.51cto.com/dadonggg/1951820#">?</a>

<code>    </code><code>[nginx]  </code>

<code>    </code><code>name=nginx repo  </code>

<code>    </code><code>baseurl=http://nginx.org/packages/centos/</code><code>$releasever</code><code>/</code><code>$basearch</code><code>/  </code>

<code>    </code><code>gpgcheck=0  </code>

<code>    </code><code>enabled=1</code>

在編輯這個檔案時,沒有對齊

2.編輯并儲存/etc/yum.repos.d/nginx.repo檔案後,在指令行下執行

<code>    </code><code>[root</code><code>@localhost</code> <code>~]</code><code># yum list | grep nginx      nginx.i386                               1.4.7-1.el6.ngx               @nginx     </code>

<code>    </code><code>nginx-debug.i386                         1.4.7-1.el6.ngx               nginx</code>

會發現就是最新的穩定版

于是直接執行

<code>    </code><code>yum -y install nginx</code>

再次安裝Nginx後就正常了,出現了我們最喜歡的安裝完成界面了。

<a href="https://s5.51cto.com/wyfs02/M01/9D/31/wKioL1l7Hk2DQxvCAAArvJCOiSg842.png" target="_blank"></a>

本文轉自寫個部落格騙錢部落格51CTO部落格,原文連結http://blog.51cto.com/dadonggg/1951820如需轉載請自行聯系原作者

菜鳥東哥

繼續閱讀