RHEL6配置CentOS yum源

RHEL6配置CentOS yum源

Written by Zak Zhu

参考

  • Redhat6使用CentOS的yum源在线安装软件(https://www.aliyun.com/jiaocheng/150567.html)

步骤

  1. 删除RHEL6原有的yum

    rpm -aq | grep yum | xargs rpm -e --nodeps
  2. 下载CentOS6的yum安装包

    cd /usr/local/src/ ; mkdir centos_yum/ ; cd centos_yum/
    wget http://vault.centos.org/6.0/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
    wget http://vault.centos.org/6.0/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
    wget http://vault.centos.org/6.0/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
    wget http://vault.centos.org/6.0/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
  3. 安装yum软件包

    rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
    rpm -ivh yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
    rpm -ivh yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
  4. 更改yum源(使用网易的CentOS6镜像源)

    cd /etc/yum.repo.d/
    wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo
    vim CentOS6-Base-163.repo    # 把文件里"$releasever"全部替换为"6"----使用`:%s/$releasever/6`, 保存并退出

    RHEL6配置CentOS yum源_第1张图片

  5. 清理旧yum缓存, 生成新yum缓存

    yum clean all
    yum makecache

你可能感兴趣的:(RHEL6配置CentOS yum源)