第一步:修复 DNS(最关键)
bash
运行
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 114.114.114.114" >> /etc/resolv.conf
第二步:下载阿里云 CentOS7 国内源
bash
运行
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
第三步:清理并生成新缓存
bash
运行
yum clean all
yum makecache
第四步:现在再装 epel-release
bash
运行
yum install -y epel-release
. # 关闭防火墙和SELinux(测试环境专用!生产环境需单独配置)
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
yum install -y net-tools vim wget lrzsz unzip zip git htop ntpdate telnet tree dos2unix
包含的所有必备工具:
net-tools:ifconfig、netstat 网络命令
vim:编辑器
wget:下载工具
lrzsz:rz/sz 上传下载
unzip/zip:解压压缩
git:代码工具
htop:系统监控
ntpdate:时间同步
telnet:端口测试
tree:目录树查看
dos2unix:格式转换
1. --enable-agent2
删除原因:Go 编写,和你的 OpenSSL 1.1.1 冲突,100% 编译失败
2. --with-mysql-includes=
3. --with-mysql-libs=
删除原因:你现在用 yum 安装的 MySQL,不需要手动指定路径,写了反而报错
4. --with-ssh2
删除原因:依赖系统旧 OpenSSL,和你安装的 1.1.1 冲突
5. --with-libpthread
删除原因:系统自带,重复、多余
6. --with-libevent-include= + --with-libevent-lib=
删除原因:--with-libevent= 已经包含路径,重复多余,会导致冲突