• 备份原有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

       

    #脚本结束

  • 相关阅读:
    OneDay!——冲刺日志9(05-06)
    Hail_Hydra2—代码规范
    Hail_Hydra2—凡事预则立
    Alpha冲刺的问题总结
    Hail_Hydra2—冲刺日志集合
    Hail_Hydra2—总结随笔
    Hail_Hydra2—测试随笔
    Hail_Hydra2—冲刺日志(10)
    Hail_Hydra2—冲刺日志(9)
    Hail_Hydra2—冲刺日志(8)
  • 原文地址:https://www.cnblogs.com/withfeel/p/10669276.html
Copyright © 2020-2023  润新知