如何为Centos7换源

时间:2024-10-12 22:18:45

有时centos的源可能不太稳定,那么如何换成清华的源呢?下面给大家介绍下!如何换到清华大学开源软件镜像站

如何为Centos7换源

如何为Centos7换源

1、首先备份文件sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak如图

如何为Centos7换源

2、然后使用sudo vi /etc/yum.repos.d/CentOS-Base.repo打开配置文件如图

如何为Centos7换源

3、拷贝https://mirrors.tuna.tsinghua.edu.cn/help/centos/里的内容如图内容输入进去

如何为Centos7换源

4、然后输入:wq写入新的内容

如何为Centos7换源

5、此时,配置文件已经修改了然后输入sudo yum makecache更新源

如何为Centos7换源

6、然后就能看见如下信息,就表示更新成功了!

如何为Centos7换源
© 手抄报圈