Linux Redhat 和 CentOS配置国内163的yum源
2016-11-07 00:00
387 查看
Redhat和CentOS的默认yum源都是国外的,国内环境访问会比较慢,感谢163镜像,直接直接在国内访问。本文最简方式记录下配置。
首先根据本地版本选择对应的镜像配置,并下载.
首先在服务器上查看版本
如果返回是6.x则便是是6这个版本,请选择下载6对应的yum配置文件。其他版本类似。
CentOS 5 : wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS 6 : wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7 : wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
修改下配置,默认的模式有问题(redhat6.2下测试)~
使用vim打开新下载的CentOS6-Base-163.repo,手动修改下配置文件里面所有baseurl属性值的$releasever为对应的OS主版本号(5,6,7),如:
修改为:
完成后,:wq保存退出。
清理并重新下载yum配置
OK, 完成,你可以使用:yum install anything~~
163镜像源
首先请访问:http://mirrors.163.com/.help/ ,直接查看163镜像源的帮助说明。其中CentOS可以支持5,6,7多个版本,同时也适应于对应的redhat版本。详情请参考:http://mirrors.163.com/.help/centos.html安装配置
首先备份本机默认的CentOS-Base.repo文件(如果你有的话)mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
首先根据本地版本选择对应的镜像配置,并下载.
首先在服务器上查看版本
# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.2 (Santiago) # cd /etc/yum.repos.d/ # wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
如果返回是6.x则便是是6这个版本,请选择下载6对应的yum配置文件。其他版本类似。
CentOS 5 : wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS 6 : wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7 : wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
修改下配置,默认的模式有问题(redhat6.2下测试)~
使用vim打开新下载的CentOS6-Base-163.repo,手动修改下配置文件里面所有baseurl属性值的$releasever为对应的OS主版本号(5,6,7),如:
[base] name=CentOS-$releasever - Base - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
修改为:
[base] name=CentOS-6 - Base - 163.com baseurl=http://mirrors.163.com/centos/6/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
完成后,:wq保存退出。
清理并重新下载yum配置
yum clean all yum makecache
OK, 完成,你可以使用:yum install anything~~
相关文章推荐
- CentOS6.4配置163的yum源 分类: Linux 2015-06-02 22:45 32人阅读 评论(0) 收藏
- Linux-CentOS 配置国内YUM源
- redhat/centos配置163或者epel的YUM源。
- linux redhat配置yum源为网易(163)源的方法 (
- 配置RedHet linux 的yum源为163的CentOS
- CentOS配置YUM源(163、搜狐)
- CentOS配置163 YUM源
- 配置国内的yum源和epel源(163/ustc)
- RedHat和CentOS使用本地yum源配置
- RedHat Enterprise Linux 6.4使用Centos 6 的yum源
- RedHat Enterprise Linux 6.4使用Centos 6 的yum源
- redhat(centos) linux下配置普通用户关机、重启服务器
- Linux5.5下配置Centos的yum源
- CentOS6.4配置163的yum源
- 在redhat/centos的linux环境下安装配置java web运行环境
- RedHat Enterprise Linux 6.4使用Centos 6 的yum源
- 配置RedHat使用163的yum源
- Linux学习笔记---RHEL-5配置CentOS-5的yum源
- CentOS配置YUM源(163、搜狐)
- Centos系统配置国内163网易yum源shell自动安装脚本