歡迎您光臨本站 註冊首頁

CentOS使用技巧---更改yum鏡像站點為中國站點地址

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0
很多人選擇CentOS源於他的開源、免費、可升級.我選擇他最看重最后一點---可升級.開源不用說,linux嘛;免費,哈我是一個提倡盜版者;可升級這點可就是CentOS的絕對優勢了,你可以像使用正版紅帽一樣!I love Red Hat,So I love CentOS.
閑話少敘,奔主題.使用yum安裝軟體,升級系統是非常方便的.但如果網速不行,或在學校(就像首師大)訪問國外網成問題的,升級起來慢死.這樣,最好更改yum鏡像站點為中國站點地址,這裡推薦[url]http://centos.ustc.edu.cn/centos/[/url].中國科技大學的鏡像站點.(瞧人家多NB,人家那也是大學,再看...).
修改/etc/yum.repos.d/CentOS-Base.repo
如下:
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# 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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://centos.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://centos.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released


[addons]
name=CentOS-$releasever - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://centos.ustc.edu.cn/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://centos.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

簡單的說就是把mirrorlist註釋掉,將baseurl改成ustc.edu.cn的鏡像地址.
我實驗沒問題,有問題希望交流.
一次性火機,QQ:591880471



[火星人 ] CentOS使用技巧---更改yum鏡像站點為中國站點地址已經有811次圍觀

http://coctec.com/docs/linux/show-post-55131.html