CentOS6.4配置163的yum源

CentOS系统自带的更新源的速度实在是慢,为了让CentOS6使用速度更快的YUM更新源,可以选择163(网易)的更新源。

1.下载repo文件

  1. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

2.备份并替换系统的repo文件

  1. [[email protected] ~]# cd /etc/yum.repos.d/
  2. [[email protected] ~]# mv CentOS-Base.repo CentOS-Base.repo.bak
  3. [[email protected] ~]# mv CentOS6-Base-163.repo CentOS-Base.repo

3.执行yum源更新

  1. [[email protected] ~]# yum clean all
  2. [[email protected] ~]# yum makecache
  3. [[email protected] ~]# yum update

贴出Centos 6.4 32位的配置文件, 如果没有需要手工创建就可以了
[[email protected] ~]# cat /etc/yum.repos.d/CentOS-Base.repo
# 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
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/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
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

#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://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

[[email protected] ~]# cat /etc/yum.repos.d/CentOS-Debuginfo.repo
# CentOS-Debug.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.
#

# All debug packages from all the various CentOS-5 releases
# are merged into a single repo, split by BaseArch
#
# Note: packages in the debuginfo repo are currently not signed
#

[debug]
name=CentOS-6 - Debuginfo
baseurl=http://debuginfo.centos.org/6/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6
enabled=0

[[email protected] ~]# cat /etc/yum.repos.d/CentOS-Vault.repo
# CentOS-Vault.repo
#
# CentOS Vault holds packages from previous releases within the same CentOS Version
# these are packages obsoleted by the current release and should usually not
# be used in production
#-----------------

[C6.0-base]
name=CentOS-6.0 - Base
baseurl=http://vault.centos.org/6.0/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.0-updates]
name=CentOS-6.0 - Updates
baseurl=http://vault.centos.org/6.0/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.0-extras]
name=CentOS-6.0 - Extras
baseurl=http://vault.centos.org/6.0/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.0-contrib]
name=CentOS-6.0 - Contrib
baseurl=http://vault.centos.org/6.0/contrib/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.0-centosplus]
name=CentOS-6.0 - CentOSPlus
baseurl=http://vault.centos.org/6.0/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0
#-----------------

[C6.1-base]
name=CentOS-6.1 - Base
baseurl=http://vault.centos.org/6.1/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.1-updates]
name=CentOS-6.1 - Updates
baseurl=http://vault.centos.org/6.1/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.1-extras]
name=CentOS-6.1 - Extras
baseurl=http://vault.centos.org/6.1/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.1-contrib]
name=CentOS-6.1 - Contrib
baseurl=http://vault.centos.org/6.1/contrib/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.1-centosplus]
name=CentOS-6.1 - CentOSPlus
baseurl=http://vault.centos.org/6.1/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0
#-----------------

[C6.2-base]
name=CentOS-6.2 - Base
baseurl=http://vault.centos.org/6.2/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.2-updates]
name=CentOS-6.2 - Updates
baseurl=http://vault.centos.org/6.2/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.2-extras]
name=CentOS-6.2 - Extras
baseurl=http://vault.centos.org/6.2/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.2-contrib]
name=CentOS-6.2 - Contrib
baseurl=http://vault.centos.org/6.2/contrib/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.2-centosplus]
name=CentOS-6.2 - CentOSPlus
baseurl=http://vault.centos.org/6.2/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0
#-----------------

[C6.3-base]
name=CentOS-6.3 - Base
baseurl=http://vault.centos.org/6.3/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.3-updates]
name=CentOS-6.3 - Updates
baseurl=http://vault.centos.org/6.3/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.3-extras]
name=CentOS-6.3 - Extras
baseurl=http://vault.centos.org/6.3/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.3-contrib]
name=CentOS-6.3 - Contrib
baseurl=http://vault.centos.org/6.3/contrib/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.3-centosplus]
name=CentOS-6.3 - CentOSPlus
baseurl=http://vault.centos.org/6.3/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

 
   

然后我把163的源CentOS-Base-163.repo放在了/etc/yum.repos.d下,然后 yum makecache报错

  • [[email protected] yum.repos.d]# yum makecache
  • Loaded plugins: fastestmirror, refresh-packagekit, security
  • Loading mirror speeds from cached hostfile
  • * addons: mirrors.163.com
  • * base: mirrors.btte.net
  • * extras: mirrors.btte.net
  • * updates: mirrors.btte.net
  • http://mirrors.163.com/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
  • Trying other mirror.
  • http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
  • Trying other mirror.
  • Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again

下载地址:http://mirrors.163.com/.help/CentOS6-Base-163.repo

按照上面的方法替换 搞定

如果还报错误 说明你的.repo  里面的路径不对  需要根据错误找出路径,然后将改文件删除,或者移除  。

时间: 2024-12-11 04:18:20

CentOS6.4配置163的yum源的相关文章

centos6.5配置163的yum源

CentOS系统自带的更新源的速度实在是慢,为了让CentOS6使用速度更快的YUM更新源,可以选择163(网易)的更新源. 1.下载repo文件 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 2.备份并替换系统的repo文件 [[email protected] ~]# cd /etc/yum.repos.d/ [[email protected] ~]# mv CentOS-Base.repo CentOS-Base.repo

CentOS 配置163的yum源更新笔记

CentOS系统自带的更新源的速度实在是慢,为了让CentOS6使用速度更快的YUM更新源,可以选择163(网易)的更新源. # cd /etc/yum.repos.d/ # wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 备份并替换系统的repo文件 # mv CentOS-Base.repo CentOS-Base.repo.bak # mv CentOS6-Base-163.repo CentOS-Base.repo 执行yu

CentOS配置163的yum源

通常我们安装好Linux后,使用yum安装和更新的时候,大部分的URL都是国外的地址,所以导致进度比较慢.其实,我们可以自己修改yum源,使用国内的yum源,这样效率会更高.以163yum源为例,其他与之类似: 1.首先下载好yum文件 wgethttp://mirrors.163.com/.help/CentOS6-Base-163.repo 2.备份并替换系统的REPO文件 [[email protected] ~]# cd /etc/yum.repos.d/ [[email protect

RedHat 7.2 配置163 CentOS YUM源

RedHat 的更新包只对注册的用户生效,所以我们自己手动更改成国内 163,sohu 等第三方CentOS 的更新包,CentOS几乎和RedHat是一样的,注意选择对应的版本,本人是在虚拟机中安装的RedHat 7.2,所以选择对应CentOS 7.2.1511的更新包.下面看一下如何使用CentOS的YUM源 1.首先删除redhat原有的yum组件 ,因为redhat 原本的yum 没有注册为redhat用户是用不了的,输入如下命令行: [[email protected] Deskto

CentOS配置163网络yum源

在安装完CentOS后一般需要修改yum源,才能够在安装更新rpm包时获得比较理想的速度.国内比较快的有163源.sohu源.这里以163源为例子. 1. cd /etc/yum.repos.d 2. mv CentOS-Base.repo CentOS-Base.repo.backup 3. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 4. mv CentOS6-Base-163.repo CentOS-Base.repo 5

在Centos6.5中配置国内网络yum源以及本地yum源

一.本地yum     1.       创建目录.挂载光盘以及安装createrepo [[email protected] ~]# mkdir/mnt/cdrom                  ←用于挂载光盘 [[email protected] ~]# mkdir-vp /yum/localrepo    ←用于存放光盘中的rpm包 mkdir: 已创建目录 "/yum" mkdir: 已创建目录 "/yum/localrepo" [[email prot

centos6配置本地光盘yum源、rhel7修改网卡名称为eth0

VMware安装好centos/rhel后要配置的几点(配置本地光盘yum源.修改网卡名称为eth0等) [[email protected] ~]# setenforce 0 [[email protected] ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config [[email protected] ~]# tar zcvf /root/redhat.repo.tgz /etc/yum.repos.d/

详解CentOS设置163的yum源的过程

转自启动CentOS系统,打开火狐浏览器,如下图所示: 2 登录"mirrors.163.com",如下图所示: 3 点击centos后面的"centos使用帮助",如下图所示: 4 可以看到设置和使用163的yum源的方法步骤都说的一清二楚,按照说明操作即可,特别值得注意的是"4小时更新一次",如下图所示: 5 根据自己的CentOS系统的版本下载相应的repo文件,我的系统是CentOS 6.6,所以选择下载"CentOS6&quo

redhat配置centos的yum源

redhat默认不支持第三方的yum源,要求有rhn账号,下面就rhel5和rhel6改为centos源 一.rhel5.5 X86_64更改为centos的yum源 查看系统自带的yum相关的rpm包  rpm -qa|grep yum 删掉系统自带的yum相关的包 rpm -e --nodeps yum-updatesd-0 rpm -e --nodeps yum-security   rpm -e --nodeps yum-metadata-p rpm -e --nodeps yum-rh