2012年6月3日 星期日

CentOS yum設定檔


最近Lab網頁主機替換,我為它裝上了CentOS 5.2,發現鳥哥網站寫的直接在mirrorlist加入&cc=tw 的方法對於學術網路的安裝與更新來說,實在太慢了。
研究了一下,終於將它換成對應到義守大學檔案伺服器的mirror。如此,連線速度就可以快很多倍囉!
以下是我的設定檔(位於/etc/yum.repos.d/CentOS-Base.repo):
[base]
name=CentOS-$releasever – Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&cc=tw
baseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever – Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&cc=tw
baseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever – Addons
baseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/addons/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons&cc=tw
gpgcheck=1
gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
baseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&cc=tw
gpgcheck=1
gpgkey=http://ftp.isu.edu.tw/pub/Linux/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&cc=tw
baseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5
Note由於沒有設定mirrorlist,萬一義守的檔案伺服器掛掉,可能就不能更新了。Orz…

沒有留言:

張貼留言