第一步,清空所有repo文件

cd /etc/yum.repos.d/

删除所有文件:

rm -f /etc/yum.repos.d/*

第二步:配置清华源

新建两个文件vim CentOS-Base.repo和vim epel.repo

vim CentOS-Base.repo

# 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=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
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=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

vim epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.tuna.tsinghua.edu.cn/epel/7/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

添加RPM-GPG-KEY-EPEL-7

curl https://mirrors.tuna.tsinghua.edu.cn/epel/RPM-GPG-KEY-EPEL-7 > /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

运行以下命令生成缓存

yum clean all
yum makecache

配置阿里源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

运行以下命令生成缓存

yum clean all
yum makecache

CentOS7.8 换清华源和阿里源相关推荐

  1. ubuntu18.04.4 pip3 换清华、阿里、豆瓣 源

    文章目录 ubuntu18.04.4 pip3 换源 官方源 清华源 阿里源 豆瓣源 中国科学技术大学源 华中科技大学源 永久换源 1 创建 .pip文件 2 进入文件 3 创建pip.conf文件 ...

  2. ubuntu20.04 apt-get换国内源 阿里源 163源 清华源 中科大源

    1.备份系统自带源 mv /etc/apt/sources.list /etc/apt/sources.list.bak 2.修改/etc/apt/sources.list文件,加入想替换的国内源,我 ...

  3. ubuntu配置163源和阿里源

    ubuntu上使用apt-get时,有时候网络链接会非常慢,这时可以替换源. 1. 保存原始的source.list文件 # sudo mv /etc/apt/source.list /etc/apt ...

  4. centos7 配置国内yum源和epel源

    组合脚本: yum install -y wget cd /etc/yum.repos.d/ mkdir repo_bak mv *.repo repo_bak/ wget http://mirror ...

  5. 清华源和torch源

    没有网络时,pip无法安装,可下载*.whl,再用pip安装 torch源码:https://download.pytorch.org/whl/torch_stable.html 清华源:Simple ...

  6. Python添加清华源和豆瓣源

    Conda添加清华源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ cond ...

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

    CentOS7配置阿里云yum源和EPEL源 1.备份 [root@bogon ~]# cd /etc/yum.repos.d/ [root@bogon yum.repos.d]# mkdir rep ...

  8. Ubuntu 18.04换国内源 中科大源 阿里源 163源 清华源

    Ubuntu 18.04换国内源 中科大源 阿里源 163源 清华源 内有很多Ubuntu的镜像源,包括阿里的.网易的,还有很多教育网的源,比如:清华源.中科大源. 我们这里以中科大的源为例讲解如何修 ...

  9. Ubuntu 20.04换国内源 清华源 阿里源 中科大源 163源

    Ubuntu 20.04 是 Ubuntu 的第 8 个 LTS 版本,其重大更新和改进将在 2030 年前终止,计划于2020年 4 月 23 日发布. 国内有很多Ubuntu的镜像源,包括阿里的. ...

最新文章

  1. 译者招募 | 《Java编程思想》作者Bruce Eckel新作On Java 8
  2. 其实,我是一名程序员!
  3. 数据结构与算法JavaScript描述——使用队列
  4. 大型分布式C++框架《四:netio之请求包中转站 上》
  5. node.js博客GitHub搭建(hexo)
  6. OrderOnline——设计概述
  7. 骚操作!他居然同时给谷歌和 Facebook 上班干活
  8. [ANSYS APDL] 平面单元应力分析全步骤截图详解
  9. Pycharm 相关使用方法
  10. 三个linux系统共存,修改默认启动
  11. LIBSVM使用方法及参数设置
  12. [管理]ERP专业术语
  13. 网络控制播放器(局域网内通过TCP和UDP控制视频播放器)
  14. Microsemi Libero系列教程(全网首发)
  15. 聊聊旷厂黑科技 | 手机多摄的终极奥义是“多”吗?
  16. js-时间相关操作(获取当前日期、最近三天、近一月及前N天的日期)
  17. Marlin固件之—:基础入门与测试
  18. centos7安装boot分区_图文详解centos Linux系统安装教程
  19. 拍照手机哪款好?华为Mate 20 Pro值不值得买
  20. hisi3559平台PCIE转USB调试

热门文章

  1. PermissionError: [Errno 13] Permission denied 如何解决
  2. PyCharm永久破解
  3. 【人脸识别实战二】服务器端设计与实现
  4. 深度学习文本分类模型使用TextPruner实战
  5. 送给@吴迪 的话,也是送给大家的话!
  6. C语言 - 申请内存
  7. pycharm获取yelp相关数据(三)
  8. PDF是什么格式?怎么才能生成PDF文件?
  9. 容器技术---(二)kubernetes集群部署
  10. android 搜狗地图包名,搜狗地图(免费语音导航)