zoukankan      html  css  js  c++  java
  • 备份原有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

       

    #脚本结束

  • 相关阅读:
    Apple Swift编程语言入门教程
    网络请求错误
    Mac使用大全
    MPMovieplayerController添加新控件
    ios9 新变化
    UITableView总结
    UINavigationController的简单学习
    HTML
    谓词(NSPredicate)
    NSString字符串
  • 原文地址:https://www.cnblogs.com/withfeel/p/10669276.html
Copyright © 2011-2022 走看看