CentOS使用163镜像
来源:互联网 发布:中国馆建筑 知乎 编辑:程序博客网 时间:2024/05/16 12:10
在使用RedHat企业版的时候,用yum install软件的时候指向的是RedHat的官方地址,如果没有注册是不能使用的,所以当时就想换成CentOS的镜像,后来重新安装了CentOS系统,又觉得163的源比较快,所以就又将默认的源换成了163的镜像。按照163镜像官网上的提示进行操作即可:
(http://mirrors.163.com/.help/centos.html)。
1、 首先备份/etc/yum.repos.d/CentOS-Base.repo: mv /etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup
2、下载对应版本的repo文件,放入/etc/yum.repo.d/中,我安装的是CentOS6的系统,所以下载的是6版本的文件。文件内容如下,可以将其拷贝并保存为CentOS-Base.repo。CentOS6-Base-163
#CentOS-Base.repo
#
# Themirror system uses the connecting IP address of the client and the
# updatestatus of each mirror to pick mirrors that are updated to and
#geographically close to the client. Youshould use this for CentOS updates
# unlessyou are manually picking other mirrors.
#
# If themirrorlist= does not work for you, as a fall back you can try the
# remarkedout baseurl= line instead.
#
#
[base]
name=CentOS-$releasever- Base - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#releasedupdates
[updates]
name=CentOS-$releasever- Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additionalpackages that may be useful
[extras]
name=CentOS-$releasever- Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additionalpackages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever- Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib -packages by Centos Users
[contrib]
name=CentOS-$releasever- Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
将上面的文件放入/etc/yum.repos.d/中之后,分别执行以下指令:
yum clean all
yum makecache
完成之后再执行yumupdate,如果全部成功执行,则此时已经可以使用163的镜像了。
PS:我在使用163镜像的过程中,因为CentOS6系统是安装在VM虚拟机中的,在更换163镜像时,网络设置的是hostonly模式,后来为了使用SSH远程登录,我将网络切换到了NAT模式,这个时候发现yum用不了了,这时将网络切回到hostonly即可重新使用yum,具体原因不是很清楚。
- CentOS使用163镜像
- CentOS镜像使用
- CentOS 163镜像使用帮助
- CentOS镜像使用帮助
- CentOS镜像使用帮助
- CentOS镜像使用帮助
- CentOS镜像使用帮助
- xen安装CentOS虚拟机(使用163镜像)
- CentOS添加163镜像
- CentOS国内镜像
- 制作CentOS镜像
- centos 镜像下载
- 合并CentOS镜像
- centos镜像下载
- CentOS 镜像大全
- feshshop centos 镜像
- CentOS使用iso镜像文件配置本地yum源
- 制作OpenStack上使用的CentOS系统镜像
- iOS 动画效果:Core Animation & Facebook's pop
- 【知乎解答】cocos2d-x中Contestsize和Dimensions有什么不同
- Spring学习第一天
- Spring事务Transaction配置的五种注入方式详解
- 变换后矩阵右上三角元素和与左下三角元素和可能的最大差值
- CentOS使用163镜像
- Spring结合java Quartz配置实例代码
- OC面试中,Block常出现的三个问题
- <一>认识
- 利用正则表达式去除字符串中的空格
- java S2SH项目框架整合搭建实例教程
- angular学习日志04 购物车!
- python+opencv cv2.VideoCapture获取视频失败 解决方法
- linux编译ffmpeg2.8.4