使用root账户进行操作,如果当前用户不是root用户。使用su命令进行提权。

1.进入yum配置文件目录

cd /etc/yum.repos.d

2.备份yum源,方便操作失败之后进行恢复

mv CentOS-Base.repo CentOS-Base.repo.bak

3.获取阿里云镜像文件

wget http://mirrors.aliyun.com/repo/Centos-7.repo

4.更换yum文件为阿里云镜像

mv Centos-7.repo CentOS-Base.repo

5.清除之前的yum缓存,然后重新生成缓存

yum clean all

yum makecache

yum update

相关文章:

  • 2022-12-23
  • 2021-05-15
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-15
  • 2021-05-27
  • 2021-10-25
  • 2021-12-06
  • 2022-12-23
  • 2021-10-02
  • 2021-09-27
相关资源
相似解决方案