仓酷云

标题: Linux教程之CentOS修正Yum的更新源教程 [打印本页]

作者: 小魔女    时间: 2015-1-14 21:14
标题: Linux教程之CentOS修正Yum的更新源教程
小知识:CentOS(CommunityEnterpriseOperatingSystem,中文意思是:社区企业操作系统)是Linux发行版之一。
CentOS默许的yum更新源是从镜像列表猎取的,体系会依据你的速率及区域主动检测一个速率较快的更新源并利用此更新源。假如CentOS在国际,却利用外洋的源,或默许的源没法毗连,则必要手动修正更新源列表了。


1、编纂源设置文件

  1. vim/etc/yum.repos.d/CentOS-Base.repo
复制代码
默许的源以下:
#CentOS-Base.repo
#
#ThemirrorsystemusestheconnectingIPaddressoftheclientandthe
#updatestatusofeachmirrortopickmirrorsthatareupdatedtoand
#geographicallyclosetotheclient.
YoushouldusethisforCentOSupdates
#unlessyouaremanuallypickingothermirrors.
#
#Ifthemirrorlist=doesnotworkforyou,asafallbackyoucantrythe
#remarkedoutbaseurl=lineinstead.
#
#
[base]
name=CentOS-$releasever-Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#releasedupdates
[updates]
name=CentOS-$releasever-Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#packagesused/producedinthebuildbutnotreleased
[addons]
name=CentOS-$releasever-Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additionalpackagesthatmaybeuseful
[extras]
name=CentOS-$releasever-Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additionalpackagesthatextendfunctionalityofexistingpackages
[centosplus]
name=CentOS-$releasever-Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib-packagesbyCentosUsers
[contrib]
name=CentOS-$releasever-Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
2、修正源


假如要修正为网易的源,则把一切内容交换为:
#CentOS-Base.repo
#
#ThemirrorsystemusestheconnectingIPaddressoftheclientandthe
#updatestatusofeachmirrortopickmirrorsthatareupdatedtoand
#geographicallyclosetotheclient.YoushouldusethisforCentOSupdates
#unlessyouaremanuallypickingothermirrors.
#
#Ifthemirrorlist=doesnotworkforyou,asafallbackyoucantrythe
#remarkedoutbaseurl=lineinstead.
#
#
[base]
name=CentOS-$releasever-Base
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[updates]
name=CentOS-$releasever-Updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[addons]
name=CentOS-$releasever-Addons
baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-$releasever-Extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

[centosplus]
name=CentOS-$releasever-Plus
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
最初,实行以下下令,更新组件
  1. yumupdate
复制代码
小知识:Linux发展和成长过程始终依赖着五个重要支柱:UNIX操作系统、MINIX操作系统、GNU计划、POSIX标准和Internet网络。
作者: 谁可相欹    时间: 2015-1-17 08:52
对我们学习操作系统有很大的帮助,加深我们对OS的理解。?
作者: 只想知道    时间: 2015-1-26 14:44
其实老师让写心得我也没怎么找资料应付,自己想到什么就写些什么,所以不免有些凌乱;很少提到编程,因为那些在实验报告里已经说了,这里再写就多余了。
作者: admin    时间: 2015-2-4 21:25
请问谁有Linux的学习心得的吗?简单的说说?
作者: 愤怒的大鸟    时间: 2015-2-10 17:29
随着实验课程的结束,理论课也该结束了,说实话教OS的这两位老师是我们遇到过的不错的老师(这话放这可能不太恰当).
作者: 蒙在股里    时间: 2015-3-1 16:02
学习Linux,应该怎样学,主要学些什么,一位Linux热心学习者,一段学习Linux的风云经验,历时十二个小时的思考总结,近十位网络Linux学习者权威肯定,为您学习Linux指明方向。
作者: 乐观    时间: 2015-3-10 23:06
直到学习Linux这门课以后,我才知道,原来我错了。?
作者: 金色的骷髅    时间: 2015-3-17 18:08
熟悉并掌握安装Linux,安装是学习的前提。目前较常见的安装方法有二种:
作者: 仓酷云    时间: 2015-3-24 21:54
目前全球有超过一百多个Linux发行版本,在国内也能找到十几个常见版本。如何选择请根据你的需求和能力,RedhatLinux和DebianLinux是网络管理员的理想选择。




欢迎光临 仓酷云 (http://ckuyun.com/) Powered by Discuz! X3.2