安装依赖
安装gcc:yum install -y gcc
安装perl库:yum install -y pcre pcre-devel
安装zlib库:yum install -y zlib zlib-devel
安装步骤
-
-
进入解压后的nginx目录,编译安装;安装到哪个目录下
./configure --prefix=/usr/local/nginx
-
No match for argument: gcc
解决步骤
1.进入配置文件内,清除所有.repo文件
cd /etc/yum.repos.d/
rm *.repo #输入“y”回车确认
2.重新搭建yum仓库
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
3.生成缓存
yum makecache
4.再运行命令安装
yum -y install gcc
参考:https://blog.csdn.net/weixin_48684750/article/details/126647642、https://blog.csdn.net/S_Emiya/article/details/135564076