解决centos yum安装"No package nginx available."问题


问题描述:

安装nginx时运行#yum install nginx,出现以下错误

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.cqu.edu.cn * extras: mirrors.163.com * updates: mirrors.aliyun.com base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 No package nginx available. Error: Nothing to do

 

问题原因:

nginx位于第三方的yum源里面,而不在centos官方yum源里面

解决方法:

安装epel(Extra Packages for Enterprise Linux)

https://fedoraproject.org/wiki/EPEL下载跟你服务器相对应的rpm文件

 yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM