CentOS7 设置软件镜像源
2015-10-29 22:28
537 查看
Linux拥有众多的发行版,每个发行版都有提供镜像,但是,在国内这些镜像的下载速度参差不齐,
偶尔会有更新失败的情况。
网上众多推荐的镜像源为163的镜像,笔者通过一段时间的试用,发现某些小众带宽访问163镜像还
是存在一定的问题,所以,决定替换为aliyun的镜像。
下面以修改 CentOS 默认安装源为 阿里云(http://mirrors.aliyun.com/repo/)为例进行说明:
CentOS 5
偶尔会有更新失败的情况。
网上众多推荐的镜像源为163的镜像,笔者通过一段时间的试用,发现某些小众带宽访问163镜像还
是存在一定的问题,所以,决定替换为aliyun的镜像。
下面以修改 CentOS 默认安装源为 阿里云(http://mirrors.aliyun.com/repo/)为例进行说明:
1、备份
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、配置软件源
下载新的CentOS-Base.repo 到/etc/yum.repos.d/CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo[/code]# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
View Code3、生成缓存
yum makecache
相关文章推荐
- Linux netstat命令详解
- linux 查看目录名称的方法
- linux菜鸟必搭的初步环境
- linux定时任务的设置
- linux笔记:文件处理命令touch,cat,more,less,head,tail
- Linux中环境变量文件及配置
- Linux学习一天一个命令(1)[ls命令]
- linux查看日志文件内容命令tail、cat、tac、head、echo
- linux多线程的创建基本知识
- Windows连接Linux的常用工具
- CentOS 7.1 下载,安装,配置
- Linux Postgresql 安装,使用
- linux笔记:目录处理命令ls,mkdir,cd,pwd,rmdir,cp,mv,rm
- CentOS系统下xinetd启动问题
- Linux platform驱动代码编写
- 20151029 内存结构,进程结构,Linux解压
- 安装linux系统之RHEL7或CENTOS7系统(完整版)
- Linux HA (一)
- centos6.6 yum安装telnet服务端和客户端
- Linux渗透之Ettercap详解