yum源修改


目的:將yum源改為阿里雲

步驟:

  1. 卸載默認的yum源
    rpm -qa | grep yum | xargs rpm -e --nodeps
    rpm -qa | grep python-urlgrabber | xargs rpm -e --nodeps
  2. 下載阿里雲yum包
    去阿里雲資源找,版本看系統,本次為RHEL7:https://mirrors.aliyun.com/centos/

    yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
    yum-3.4.3-154.el7.centos.noarch.rpm
    yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm
    yum-utils-1.1.31-42.el7.noarch.rpm
    python-urlgrabber-3.10-8.el7.noarch.rpm

  3. 安裝yum包
    rpm -ivh 上面下載的5個文件名,每個空格分開 --nodeps
  4. 修改配置(即跟換yum源)
    vim /etc/yum.repos.d/birdteam.repo 輸入以下配置
    #---更換 yum Start---
    [base]
    name=CentOS-7 - Base - mirrors.aliyun.com
    baseurl=http://mirrors.aliyun.com/centos/7/os/$basearch/
    gpgcheck=0
    [updates]
    name=CentOS-7 - Updates - mirrors.aliyun.com
    baseurl=http://mirrors.aliyun.com/centos/7/updates/$basearch/
    gpgcheck=0
    [extras]
    name=CentOS-7 - Extras - mirrors.aliyun.com
    baseurl=http://mirrors.aliyun.com/centos/7/extras/$basearch/
    gpgcheck=0
    #---更換 yum End---
  5. 清除yum數據,檢驗 (出現很多包和版本即為更改成功 )

    yum clean all
    yum list


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM