zoukankan      html  css  js  c++  java
  • Redhat7.2换Centos7的yum源

    Redhat7.2(未注册用户)换Centos7的yum源

    1、查看redhat7.2中yum的包版本
    [root@localhost jiayimeng]# rpm -qa | grep yum
    yum-rhn-plugin-2.0.1-5.el7.noarch
    yum-metadata-parser-1.1.4-10.el7.x86_64
    yum-langpacks-0.4.2-4.el7.noarch
    yum-utils-1.1.31-34.el7.noarch
    yum-3.4.3-132.el7.noarch

    2、删除原有的yum包
    [root@localhost jiayimeng]# rpm -e yum-rhn-plugin-2.0.1-5.el7.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 yum-langpacks-0.4.2-4.el7.noarch yum-utils-1.1.31-34.el7.noarch yum-3.4.3-132.el7.noarch --nodeps
    警告:/etc/yum/pluginconf.d/langpacks.conf 已另存为 /etc/yum/pluginconf.d/langpacks.conf.rpmsave

    3、下载依赖包

    wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
    wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
    wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-40.el7.x86_64.rpm
    wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-163.el7.centos.noarch.rpm
    wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-163.el7.centos.noarch.rpm
    wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
    wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm

    4、安装依赖包
    rpm -Uvh *.rpm --nodeps

    5、删除原redhat在yum源
    rm /etc/yum.repos.d/redhat.repo

    6、生成centos的yum源
    vim /etc/yum.repos.d/CentOS-Base.repo

    #++++++++++++++++++++++++ CentOS-Base.repo start ++++++++++++++++++++++#
    # 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-$7 - Base - 163.com
    #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
    baseurl=http://mirrors.163.com/centos/7/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
    
    #released updates
    [updates]
    name=CentOS-$7 - Updates - 163.com
    #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
    baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$7 - Extras - 163.com
    #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
    baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
    
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$7 - Plus - 163.com
    baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
    #++++++++++++++++++++++++ CentOS-Base.repo end ++++++++++++++++++++++#

    7、清除yum缓存
    yum clean

    8、生成缓存
    yum makecache

    9、更新yum
    yum update

  • 相关阅读:
    poj3669 广搜
    检索所有课程都选修的的学生的学号与姓名
    UVA10160 Servicing Stations
    uva11205 The broken pedometer 子集生成
    poj1101 the game 广搜
    poj3009 Curling 2.0 深搜
    poj 1564 Sum It Up 搜索
    HDU 2268 How To Use The Car (数学题)
    codeforces 467C George and Job(简单dp,看了题解抄一遍)
    HDU 2267 How Many People Can Survive(广搜,简单)
  • 原文地址:https://www.cnblogs.com/mrfo/p/12712441.html
Copyright © 2011-2022 走看看