修改yum使用163开源镜像升级CentOS,国内最快的Y

2019-07-19 作者:yzc216亚洲城   |   浏览(149)

yum使用的镜像升级和下载软件有点小慢,现在网易干了件好事就是有了这个开源镜像站,速度还不是一般的快。

版本:CentOS 6.4
框架:x86_64
更新时间:每5小时更新一次

根据网上的文章“使用163开源镜像升级你的CentOS”修改,很简单的,操作过程如下,做个笔记。平时用的是CentOS 4.7 sever版,网上多是CentOS 5.X版的,只是改动了gpgkey的验证版本和网站,因为baseurl的链接都是163的。当然不修改也可以,但是163镜像如果没有及时和CentOS镜像同步,估计使用yum时会有问题只是估计。

  1. 首先备份/etc/yum.repos.d/CentOS-Base.repo
    [[email protected] ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

  2. 下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)

1.备份系统原来的CentOS-Base.repo文件:
cd /etc/yum.repos.d/
#cp -a CentOS-Base.repo CentOS-Base.repo.bak

CentOS5

2.用vi打开CentOS-Base.repo文件:
#vim CentOS-Base.repo

CentOS6

修改后的CentOS-Base.repo文件,代码如下:

CentOS6

# 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
#yzc216亚洲城官方网站, 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.
#
#

# 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=

[base]
name=CentOS-$releasever - Base
#mirrorlist=
#baseurl=
baseurl=
gpgcheck=1
#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=

gpgkey=

  1. 运行yum makecache生成缓存
    [[email protected] yum.repos.d]# yum makecache
    Loaded plugins: fastestmirror
    Metadata Cache Created

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=
#baseurl=
baseurl=
gpgcheck=1
#gpgkey=

推荐阅读:

gpgkey=

RedHat Linux 本地yum源的配置

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#mirrorlist=
#baseurl=
baseurl=
gpgcheck=1
#gpgkey=

RedHat 6.2 Linux修改yum源免费使用CentOS源

gpgkey=

配置EPEL YUM源

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=
#baseurl=
baseurl=
gpgcheck=1
#gpgkey=

Redhat 本地yum源配置

gpgkey=

yum的配置文件说明

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=
#baseurl=
baseurl=
gpgcheck=1
enabled=0
#gpgkey=

RedHat 6.1下安装yum(图文)

gpgkey=

YUM 安装及清理

yzc216亚洲城官方网站 1

6.4 框架:x86_64 更新时间:每5小时更新一次 1. 首先备份/etc/yum.repos.d/CentOS-Base.repo [[email protected] ~]# mv /etc/yum.repos.d/CentOS-Base.repo...

本文由yzc216亚洲城发布于yzc216亚洲城,转载请注明出处:修改yum使用163开源镜像升级CentOS,国内最快的Y

关键词: yzc216亚洲城