Site icon Mr. 沙先生

設定 CentOS Yum 套件庫鏡像站台

CentOS 的套件庫預設由 mirror list 決定下載站台位置,為了加快 Yum 的速度,可以直接設定使用台灣的鏡像站台,做法如下:

shell># vim /etc/yum.repos.d/CentOS-Base.repo

[base]
name=CentOS-$releasever - Base

#註解mirrorlist這行

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever
&arch=$basearch&repo=os
#改用baseurl,並設定離你最近的鏡像站台,我個人喜歡使用hinet
baseurl=http://mirror01.idc.hinet.net/centos/$releasever
/os/$basearch/

gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
#[updates]區段同上方式修改
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever
&arch=$basearch&repo=updates
baseurl=http://mirror01.idc.hinet.net/centos/$releasever
/updates/$basearch/

gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#[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-6

完成後執行 yum 你會發現系統直接使用設定的站台

轉貼至http://beakdoosan.blogspot.tw/

Exit mobile version