1. 切换CentOS 8源为阿里源
备份原有的yum源文件,以便需要时恢复:
sudo mv /etc/yum.repos.d/CentOS-* /tmp/
下载并安装阿里云的CentOS 8源配置文件:
sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
生成缓存
sudo yum makecache
更新一下yum源:
yum -y update
如果出现这样(尝试添加 --skip-broken 来跳过无法安装的软件包 或 --nobest 来不只使用最佳选择的软件包)的报错,只需根据提示在命令结尾加上–allowerasing或–nobest后再次执行即可yum -y update --nobest
后续如果这样报错,都可以按照此方法
完成上述步骤后,就将yum镜像源更换为阿里云的了。
2. 关闭防火墙,SELINUX
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
关闭之后,查看状态
systemctl status firewalld
systemctl status selinux-autorelabel