CentOS7 更新源
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之后运行yum makecache生成缓存
Centos7 添加dns
nmcli connection show 查看当前启动的连接eth0,根据自己实际情况
nmcli con mod eth0 ipv4.dns 114.114.114.114 更改dns
nmcli con up eth0 配置生效
Centos7关闭防火墙
查看防火墙状态
firewall-cmd --state
关闭防火墙
systemctl stop firewalld.service
禁止防火墙开机自启
systemctl disable firewalld.service
本文详细介绍了如何在CentOS7中更换系统更新源,包括备份原repo文件、下载阿里云镜像源并更新缓存。同时,还提供了CentOS7下修改DNS设置的方法,确保网络访问更稳定。
1720

被折叠的 条评论
为什么被折叠?



