• 备份原有yum源,设置为自建yum源的脚本


    #脚本开始

    #!/bin/bash

    cd /etc/yum.repos.d/

    tar -zcvf yum.bak.tar.gz CentOS-*

    rm -rf CentOS*

    touch /etc/yum.repos.d/a.repo

    cat>/etc/yum.repos.d/a.repo <<EOF

    [base]

    name=base

    baseurl=http://172.16.103.3/centos/7/os/x86_64

    gpgcheck=1

    enabled=1

    gpgkey=http://172.16.103.3/centos/RPM-GPG-KEY-CentOS-7

       

       

    [update]

    name=update

    baseurl=http://172.16.103.3/centos/7/updates/x86_64/

    gpgcheck=1

    enabled=1

    gpgkey=http://172.16.103.3/centos/RPM-GPG-KEY-CentOS-7

       

    [extras]

    name=extras

    baseurl=http://172.16.103.3/centos/7/extras/x86_64

    gpgcheck=1

    enabled=1

    gpgkey=http://172.16.103.3/centos/RPM-GPG-KEY-CentOS-7

       

    [centosplus]

    name=centosplus

    baseurl=http://172.16.103.3/centos/7/centosplus/x86_64

    gpgcheck=1

    enabled=1

    gpgkey=http://172.16.103.3/centos/RPM-GPG-KEY-CentOS-7

       

    [epel]

    name=epel

    baseurl=http://172.16.103.3/epel/7/x86_64

    gpgcheck=0

    enabled=1

    gpgkey=http://172.16.103.3/epel/RPM-GPG-KEY-EPEL-7

       

    [epel-source]

    name=epel-source

    baseurl=http://172.16.103.3/epel/7/SRPMS

    gpgcheck=0

    enabled=1

    gpgkey=http://172.16.103.3/epel/RPM-GPG-KEY-EPEL-7

    EOF

    yum clean all

    yum makecache

       

    #脚本结束

  • 相关阅读:
    Linux系统负载
    full nat
    close wait 状态的随想
    记录一下 性能分析问题
    golang 反射
    socket里面那个又爱又恨的锁
    Difference between skbuff frags and frag_list
    浅析TCP协议---转载
    http 怎样关闭
    http 响应 ngx_http_send_header ngx_http_output_filter
  • 原文地址:https://www.cnblogs.com/withfeel/p/10669276.html
Copyright © 2020-2023  润新知