zoukankan      html  css  js  c++  java
  • CentOS修改yum更新源

    1. 在修改前先备份该文件

    cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

    2. 修改更新源配置文件(CentOS6地址,其他版本类似)

    vim打开配置文件:

    vim /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
    baseurl=http://mirrors.oschina.com/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
    
    [updates]
    name=CentOS-$releasever - Updates
    baseurl=http://mirrors.oschina.com/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
    
    [addons]
    name=CentOS-$releasever - Addons
    baseurl=http://mirrors.oschina.com/centos/$releasever/addons/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
    
    [extras]
    name=CentOS-$releasever - Extras
    baseurl=http://mirrors.oschina.com/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
    
    [centosplus]
    name=CentOS-$releasever - Plus
    baseurl=http://mirrors.oschina.com/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
    复制代码

    最后保存配置文件。

    3. 更新yum源配置

    yum update

    (如果不愿更新软件,选择N即可)

    (来源:http://www.cnblogs.com/shockerli/p/3716893.html

  • 相关阅读:
    Leetcode 50.Pow(x,n) By Python
    Leetcode 347.前K个高频元素 By Python
    Leetcode 414.Fizz Buzz By Python
    Leetcode 237.删除链表中的节点 By Python
    Leetcode 20.有效的括号 By Python
    Leetcode 70.爬楼梯 By Python
    Leetcode 190.颠倒二进制位 By Python
    团体程序设计天梯赛 L1-034. 点赞
    Wannafly挑战赛9 C-列一列
    TZOJ Start
  • 原文地址:https://www.cnblogs.com/liuzhi/p/3917047.html
Copyright © 2011-2022 走看看