1、centos默认的网络源为官方源,官方源为国外的站点,下载与更新速度有点慢,这时将网络源设置为国内的就会比较完美了,国内的开源镜像站点主要有:阿里云、网易、清华大学。在这里我将以阿里云、网易的进行演示。先备份 CentOS-Base.repo,以后可随时恢复。下载新的CentOS-Base.repo 到 /etc/yum.repos.d/ 目录下。

# 阿里的 ,根据自己的版本选择下载
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
 
# 网易的,根据自己的版本选择下载
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

2、重新生成yum缓存,首先清除系统yum缓存,然后重新生成新的yum缓存

[root@localhost ~]# yum clean all     
[root@localhost ~]# yum makecache

 

相关文章:

  • 2021-12-05
  • 2021-12-07
  • 2021-11-30
  • 2022-12-23
  • 2022-01-26
  • 2021-08-16
  • 2022-12-23
猜你喜欢
  • 2021-11-18
  • 2021-12-04
  • 2021-04-17
  • 2021-06-13
  • 2021-11-27
  • 2022-02-06
  • 2022-01-03
相关资源
相似解决方案