zoukankan      html  css  js  c++  java
  • 设置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 看是否能够联通

  • 相关阅读:
    sql测试
    sql时间和日期函数
    递归算法
    冒泡排序
    Ajax
    省市区下拉框三级联动
    Repeater用法
    WIndows form Linq多表联合
    C# 递归算羊
    C# 定义一个学生的结构体,输入学生信息,学号,姓名,身高,按身高排序输出
  • 原文地址:https://www.cnblogs.com/zf723/p/4583286.html
Copyright © 2011-2022 走看看