• 设置yum源


    vi /etc/sysconfig/network
    GATEWAY = 172.19.0.200
    vi /etc/resolv.conf
    nameserver 114.114.114.114
    nameserver 202.117.80.2


    将/etc/yum.repos.d/CentOS-Base.repo 备份后删除
    新建 /etc/yum.repos.d/CentOS-Base.repo这个文件
    使用上海交通大学的centos源作为软件源
    将一下文本拷贝至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
    # #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    #
    # #released updates
    [updates]
    name=CentOS-$releasever - Updates
    # #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    #
    # #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    # #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    #
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus
    # #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    #
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-$releasever - Contrib
    # #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    复制保存完成后 键入 yum update 看是否能够联通

  • 相关阅读:
    (7)排序之归并排序
    (5)排序之简单选择排序
    (4)排序之希尔排序
    (3)排序之直接插入排序
    (2)排序之快速排序
    (1)排序之冒泡排序
    Python学习
    centos下docker网络桥接
    docker下搭建gitlab
    centos版本7以上网卡名修改
  • 原文地址:https://www.cnblogs.com/zf723/p/4583286.html
Copyright © 2020-2023  润新知