版本: 6.4
框架:x86_64
更新時間:每5小時更新一次
1. 首先備份/etc/yum.repos.d/CentOS-Base.repo
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
2. 下載對應版本repo檔案, 放入/etc/yum.repos.d/(操作前請做好相應備份)
CentOS6
# CentOS-Base.repo
#
# 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 - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
gpgkey=
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
gpgkey=
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
gpgkey=
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
enabled=0
gpgkey=
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
enabled=0
gpgkey=
CentOS5
# CentOS-Base.repo
#
# 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 - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
gpgkey=
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
gpgkey=
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
gpgkey=
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
gpgkey=
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
enabled=0
gpgkey=
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=
#mirrorlist=
gpgcheck=1
enabled=0
gpgkey=
3. 執行yum makecache生成快取
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Metadata Cache Created
推薦閱讀:
Linux 本地yum源的配置
RedHat 6.2 Linux修改yum源免費使用CentOS源
配置EPEL YUM源
Redhat 本地yum源配置
yum的配置檔案說明
RedHat 6.1下安裝yum(圖文)
YUM 安裝及清理
更多CentOS相關資訊見 專題頁面