環境
- CentOS Linux release 7.7.1908
- yum 3.4.3
原因
#直接用命令安裝,簡單省事
yum install nginx
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
沒有可用軟件包 nginx。
nginx不在官方的源中,需要添加第三方源或者手動安裝。
解決
使用第三方軟件源epel,簡單省事。
安裝
EPEL是爲操作系統提供額外的軟件包,具體可訪問:https://fedoraproject.org/wiki/EPEL/zh-cn
# 命令安裝
yum install epel-release
# 更新
yum update
測試
# 再次安裝
yum install nginx
安裝成功!