环境
- 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
安装成功!