Centos 7下安装nginx,使用yum install nginx,提示没有可用的软件包
<p><span style="font-size: 16px"> Centos 7下安装nginx,使用yum install nginx,提示没有可用的软件包。</span></p><div class="cnblogs_code">
<pre><span style="font-size: 16px">18 (flaskApi) # yum -y install nginx
19 已加载插件:fastestmirror, langpacks
20 Loading mirror speeds from cached hostfile
21* base: mirrors.aliyun.com
22* extras: mirrors.aliyun.com
23* updates: mirrors.aliyun.com
24 没有可用软件包 nginx。
25 错误:无须任何处理</span></pre>
</div>
<p><span style="font-size: 16px"> </span><span style="font-size: 16px"> 原因是nginx位于第三方的yum源里面,而不在centos官方yum源里面</span></p>
<p><span style="font-size: 16px"> </span></p>
<p><span style="font-size: 16px"> 很多软件包在yum里面没有的,解决的方法,就是使用epel源,也就是安装epel-release软件包。EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS等系统。可以在下面的网址上找到对应的系统版本,架构的软件包</span></p>
<p><span style="font-size: 16px"> </span></p>
<p><span style="font-size: 16px"> 解决办法</span><span style="font-size: 16px">,安装epel</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 16px">sudo yum install epel-release</span></pre>
</div>
<p><span style="font-size: 16px"> 更新(更新时间稍微长一些,耐心等待)</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 16px">yum update</span></pre>
</div>
<p><span style="font-size: 16px"> 重新试一下:</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 16px">yum install -y nginx</span></pre>
</div>
<p><span style="font-size: 16px"> 安装成功:</span> </p>
<div class="cnblogs_code">
<pre><span style="font-size: 16px"><span style="color: rgba(0, 0, 0, 1)">已安装:
nginx.x86_64 </span>1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
作为依赖被安装:
nginx</span>-all-modules.noarch 1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
nginx</span>-filesystem.noarch 1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
nginx</span>-mod-http-geoip.x86_64 1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
nginx</span>-mod-http-image-filter.x86_64 1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
nginx</span>-mod-http-perl.x86_64 1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
nginx</span>-mod-http-xslt-filter.x86_64 1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
nginx</span>-mod-mail.x86_64 1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
nginx</span>-mod-stream.x86_64 1:1.12.2-3<span style="color: rgba(0, 0, 0, 1)">.el7
完毕!</span></span></pre>
</div>
<p> </p>
<p><span style="font-size: 16px"> 参考文档:</span></p>
<p><span style="font-size: 16px">yum install 没有可用软件包 nginx</span></p>
<p><span style="font-size: 16px">CENTOS 7 YUM 没有可用的软件包 NGINX</span></p><br><br>
来源:https://www.cnblogs.com/kaerxifa/p/11533595.html
頁:
[1]