下载在线源:######### 无法匹配系统

    1. curl -OL http://mirrors.163.com/.help/CentOS7-Base-163.repo

    手动添加yum源

    1. [root@dns-server yum.repos.d]# cat /tmp/CentOS-Base.repo
    2. #CentOS-Base.repo
    3. #
    4. # The mirror system uses the connecting IP address of the client and the
    5. # update status of each mirror to pick mirrors that are updated to and
    6. # geographically close to the client. You should use this for CentOS updates
    7. # unless you are manually picking other mirrors.
    8. #
    9. # If the mirrorlist= does not work for you, as a fall back you can try the
    10. # remarked out baseurl= line instead.
    11. #
    12. #
    13. [base]
    14. name=CentOS-$7 - Base - 163.com
    15. #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
    16. baseurl=http://mirrors.163.com/centos/7/os/$basearch/
    17. gpgcheck=1
    18. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
    19. #released updates
    20. [updates]
    21. name=CentOS-$7 - Updates - 163.com
    22. #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
    23. baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
    24. gpgcheck=1
    25. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
    26. #additional packages that may be useful
    27. [extras]
    28. name=CentOS-$7 - Extras - 163.com
    29. #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
    30. baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
    31. gpgcheck=1
    32. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
    33. #additional packages that extend functionality of existing packages
    34. [centosplus]
    35. name=CentOS-$7 - Plus - 163.com
    36. baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
    37. gpgcheck=1
    38. enabled=0
    39. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
    40. [root@dns-server yum.repos.d]#
    1. yum clean all
    2. yum makecache

    image.png

    image.png

    image.png

    卸载Redhat的yum包

    1. rpm -qa|grep yum|xargs rpm -e --nodeps

    rpm -qa|grep yum

    cd /tmp

    1. wget http://mirrors.163.com/centos/7.6.1810/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
    2. wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-167.el7.centos.noarch.rpm
    3. wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
    4. wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
    5. wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-53.el7.noarch.rpm
    6. wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-53.el7.noarch.rpm
    7. wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
    8. wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm

    安装依赖

    1. ###依赖包
    2. rpm -ivh python-chardet-2.2.1-3.el7.noarch.rpm
    3. rpm -ivh python-kitchen-1.1.1-5.el7.noarch.rpm
    4. 安装CentOS7 yun
    5. ####
    6. rpm -ivh yum-utils-1.1.31-53.el7.noarch.rpm
    7. rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
    8. rpm -ivh yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
    9. rpm -ivh yum-updateonboot-1.1.31-53.el7.noarch.rpm
    10. rpm -ivh yum-3.4.3-167.el7.centos.noarch.rpm

    下载链接无效
    访问 http://mirrors.163.com/centos 更新地址
    image.png