centos8 替换阿里云yum源

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值