若是须要下载一些镜像文件,例如CentOS或者Ubuntu等等之类的开源软件,能够再国内经过下面几个镜像站点来获取。缓存
1.备份
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.下载新的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
3.运行yum makecache生成缓存
[root@localhost ~]# yum clean all [root@localhost ~]# yum makecache [root@localhost ~]# yum update
这里解释下yum makecache:就是把服务器的包信息下载到本地电脑缓存起来。bash