#!/bin/sh
#备份yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak #配置清华源
cat > /etc/yum.repos.d/CentOS-Base.repo <<EOF
# 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
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=
enabled=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 EOF #配置epel源
cat > /etc/yum.repos.d/epel.repo <<EOF
[epel]
name=Extra Packages for Enterprise Linux - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 [epel-debuginfo]
name=Extra Packages for Enterprise Linux - $basearch - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck= [epel-source]
name=Extra Packages for Enterprise Linux - $basearch - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck= EOF #清空缓存及建立缓存
yum clean all && yum makecache

yum源 epel源 替换及安装的更多相关文章

  1. CentOS换yum源和epel源为国内源

    CentOS换源 YUM源 备份原来的repo文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bac ...

  2. Centos 中扩展 软件源 的安装 之 epel ( 为yum 扩展软件源 EPEL源 )

    EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL.CentOS和Scientif ...

  3. redhat 配置本地yum源163yum源epel 源,无需卸载yum!无须拷贝ISO,愿网上少一点垃圾教程误人子弟

    都知道redhat不收费,但是其yum服务是要收费的,不想出钱那就自己配置yum源就好了. 首先,博主之前也没用过redhat,第一次用yum装包的时候提示什么没注册之类的,balaba一大堆,然后就 ...

  4. redhat 配置本地yum源163yum源epel 源,无需卸载yum!无须拷贝ISO

    都知道redhat不收费,但是其yum服务是要收费的,不想出钱那就自己配置yum源就好了. 首先,博主之前也没用过redhat,第一次用yum装包的时候提示什么没注册之类的,balaba一大堆,然后就 ...

  5. CentOS7系统配置国内yum源和epel源

    1.首先进入/etc/yum.repos.d/目录下,新建一个repo_bak目录,用于保存系统中原来的repo文件 [root@bogon ~]# cd /etc/yum.repos.d/ [roo ...

  6. CentOS7配置阿里云yum源和EPEL源

    配置阿里云yum源(参考:http://mirrors.aliyun.com/help/centos) 1.备份 [root@bogon ~]# cd /etc/yum.repos.d/ [root@ ...

  7. centos6更换yum源和epel源

    epel是yum的一个软件用源,包含了很多基本源中没有的软件,cobbler就属于基本源中没有的软件,所以需要安装epel源. yum源: wget -O /etc/yum.repos.d/CentO ...

  8. linux常用国内的免费源及其各别的配置方法.阿里源,epel源,搜狐网易等等..

    国内的一些开源的平台收集的源,确实给我们提供了很多便利,所以我就稍微收集整理了一些常用的源和网址,我也不确定能用到什么时候!欢迎评论区留言! 搜狐开源镜像站 http://mirrors.sohu.c ...

  9. Linux 配置163yum源epel 源

    今天一个小伙伴询问博主,想换个163源(阿里源.亚马逊应该都是一样,博主没有一一验证)怎么换!博主当然兴致勃勃的准备好了指点小伙伴...但是,你没猜错,打脸了.而且最后还是和小伙伴一起配置好的,所以就 ...

随机推荐

  1. [Luogu] 四子连棋

    https://www.luogu.org/problemnew/show/P2346 广搜 #include<iostream> #include<cstring> #inc ...

  2. 数据结构实验之数组二:稀疏矩阵(SDUT 3348)

    Problem Description 对于一个n*n的稀疏矩阵M(1 <= n <= 1000),采用三元组顺序表存储表示,查找从键盘输入的某个非零数据是否在稀疏矩阵中,如果存在则输出O ...

  3. Maven项目转化出WebContent风格的目录

    这篇文章已被废弃. 现在,Deolin已经比较熟悉Maven,完全可以使用Jetty插件调试.热部署项目了. 在 [SpringMVC框架下Web项目的搭建与部署] 中,提到了将tomcat的默认上下 ...

  4. Flask-第三方插件

    Flask-Session 因为flask自带的session是将session存在cookie中: 所以才有了第三方Flask_session插件,可以将session存储在我们想存储的数据库中(r ...

  5. C语言指针方法对字符串进行去重

    自己编写了3种方法,都是使用指针的.(在LR中编写的) 1.先在原字符串进行比较,然后再放入目标字符串 Action() { char *srt="aadfeedeewwffggecccew ...

  6. Memcached 之在win10上的安装

    一.下载 http://static.runoob.com/download/memcached-win64-1.4.4-14.zip 二.安装 memcached <1.4.5 版本安装 1. ...

  7. JAVA基础知识|HTTP协议-两个特性

    一.无连接 无连接:服务器与浏览器之间的一次连接只处理一个http请求,请求处理结束后,连接断开.下一次请求再重新建立连接. 然而随着互联网的发展,一台服务器同一时间处理的请求越来越多,如果依然采用原 ...

  8. adb的一些命令

    adb pull <手机路径> <本机路径> 从手机中拉取信息到本地电脑上 adb push <本机路径> <手机路径> 从本地电脑推送信息到手机上

  9. @Transactional注解不生效的原因总结(整理网上和自己遇到的解决方案)

    1.问题背景 今天做项目,发现配置好@Transactional后,没有生效,事务没有回滚,即便在网上查资料,也没有解决,好像网上没有人发过我遇见的这种情况的帖子. 2.自己遇到的情况分析 代码结构图 ...

  10. RabbitMQ JAVA客户端调用例子

    1.安装erlang 下载地址:http://www.erlang.org/downloads 设置ERLANG环境变量 2.安装RabbitMQ 下载地址: http://www.rabbitmq. ...