[Linux-CentOS7]yum清华源CentOS7
shell直接运行
cat > 01.yumrepo.sh << 'EOF'
# 创建备份路径
mkdir -p /etc/yum.repos.d/repo.bak/
# 备份源
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/repo.bak/
# 导入镜像内容到yum文件中
cat > /etc/yum.repos.d/centos-tuna.repo << 'EOO'
#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/
enabled=1
gpgcheck=0 #released updates
[updates]
name=CentOS-\$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/updates/\$basearch/
#baseurl=https://mirrors.aliyun.com/centos/\$releasever/updates/\$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=updates
enabled=1
gpgcheck=0 #additional packages that may be useful [centosplus]
name=CentOS-\$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/centosplus/\$basearch/
#baseurl=https://mirrors.aliyun.com/centos/\$releasever/centosplus/\$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=centosplus
enabled=1
gpgcheck=0 [cloud]
name=CentOS-\$releasever - Cloud
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/cloud/\$basearch/openstack-train/
#baseurl=https://mirrors.aliyun.com/centos/\$releasever/cloud/\$basearch/openstack-train/
enabled=1
gpgcheck=0 [paas]
name=CentOS-\$releasever - paas
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/paas/\$basearch/openshift-origin13/
#baseurl=https://mirrors.aliyun.com/centos/\$releasever/paas/\$basearch/openshift-origin13/
enabled=1
gpgcheck=0 [kvm]
name=CentOS-\$releasever - kvm
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/virt/\$basearch/kvm-common/
#baseurl=https://mirrors.aliyun.com/centos/\$releasever/virt/\$basearch/kvm-common/
enabled=1
gpgcheck=0 [extras]
name=CentOS-\$releasever - extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/extras/\$basearch/
#baseurl=https://mirrors.aliyun.com/centos/\$releasever/extras/\$basearch/
enabled=1
gpgcheck=0 [epel]
name=Extra Packages for Enterprise Linux 7 - $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=1
gpgcheck=0 [epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $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=1
gpgcheck=0 [epel-source]
name=Extra Packages for Enterprise Linux 7 - $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=1
gpgcheck=0 EOO
#清除yum缓存
yum clean all
#重新做yum 缓存
yum makecache
EOF
# 执行该脚本
bash 01.yumrepo.sh
[Linux-CentOS7]yum清华源CentOS7的更多相关文章
- 修改linux下yum镜像源为国内镜像
修改为163yum源-mirrors.163.com 1.首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo [root@localhost ~]# m ...
- linux修改yum本地源的方法
CentOS 系统下修改yum本地源: mkdir /mnt/cdrom/ cd /etc/yum.repos.d/mv CentOS-Base.repo CentOS-Base.repo.bakvi ...
- centos7换清华源
一 删除其他源 cd /etc/yum.repos.d/ 二 创建源 vim CentOS-Base.repo # CentOS-Base.repo # # The mirror system use ...
- 【linux】yum本地源制作
在/etc/yum.repos.d/ 目录下,有两个文件 CentOS-Base.repo和 CentOS-Media.repo 其中CentOS-Base.repo 记录着网络上的 yum 源的地 ...
- RedHat Linux设置yum软件源为本地ISO
先挂载ISO到某个目录下(如我的:/media/RHEL_6.0 x86_64 Disc 1) # mount –o loop rhel-server-6.4-x86_64-dvd.iso /medi ...
- [Linux]Redhat7配置CentOS7 YUM源
一.简介 安装Redhat7并配置了网卡之后,虽然可以直接ping www.baidu.com,但是执行yum install的命令时提示如下信息: [root@ansible ~]# yum ins ...
- (转)搭建企业内部yum仓库(centos6+centos7+epel源)
搭建企业内部yum仓库(centos6+centos7+epel源) 原文:https://www.cnblogs.com/nulige/p/6081192.html https://www.linu ...
- CentOS7系统更换YUM Repo源
CentOS7系统更换YUM Repo源 备份原镜像 sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.re ...
- centos7 更新yum安装源
系统自带的yum安装源有些软件找不到 这里我们使用阿里云的源 1.加源 wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/re ...
随机推荐
- VMware Workstation CentOS7 Linux 学习之路(1)--系统安装
前言 很早就想学习Linux了,出去面试很多家公司都问会不会Linux,都很尴尬,一直没学过Linux,在网上也看过很多资料,也安装了VM,自己摸索着学习Linux,之前看网上的一些命令一顿操作, ...
- django count(*) 慢查询优化
分页显示是web开发常见需求,随着表数据增加,200万以上时,翻页越到后面越慢,这个时候慢查询成为一个痛点,关于count(*)慢的原因,简单说会进行全表扫描,再排序,导致查询变慢.这里介绍postg ...
- vue学习笔记2:藕断丝连的 v-show 和 v-if
一.知识点 vue指令 v-show v-if 二.代码案例 v-show <div v-show="isShow">动态显示或隐藏</div> <! ...
- 让你的 Linux 命令骚起来
目录 管道符号 " | " grep sed awk sort comm uniq tr cat head tail wc find tsort tee 「>」重定向符号 「 ...
- 个人任务day5
今日计划: 写登录界面,学习如何使用js做出界面跳转的进度条动态显示. 昨日成果: 创建用户数据库.
- LOJ6053 简单的函数
题目传送门 分析: 对于这道题来说,当\(x\)为质数时: \(~~~~f(x)=x-1+2[x=2]\) 因为除2以外的质数都是奇数,它们与1异或就是减一,然后2就是加一 然后我们先来康康怎么快速求 ...
- swoole(PHP异步网络通信引擎)的结构和运行流程
swoole结构说明和运行流程 主要分为三个部分: 1.Master:swoole的主进程 处理swoole核心的事件驱动, 它包含多个线程(蓝色Reactor), 所有事件的监听都在Reactor实 ...
- P4173 残缺的字符串(FFT字符串匹配)
P4173 残缺的字符串(FFT字符串匹配) P4173 解题思路: 经典套路将模式串翻转,将*设为0,设以目标串的x位置匹配结束的匹配函数为\(P(x)=\sum^{m-1}_{i=0}[A(m-1 ...
- CTF--HTTP服务--SSI注入
开门见山 1. 扫描靶场ip,发现VM 192.168.31.160 2. 扫描主机服务信息和服务版本 3. 快速扫描靶场全部信息 4. 探测开放的http的敏感信息 5. 再用dirb扫描敏感页面 ...
- 解决AS加载gradle时出现的Could not find com.android.tools.build:gradle:3.5.0.的错误
时间:2019/12/7 最近在做安卓大作业时总是遇到从GitHub上下载下来的demo不能在本地Android studio中运行的问题,感觉真的被安卓中的各种版本给恶心到了,下面记录其中比较典型的 ...