問題描述:
安裝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