CentOS7.9.2009的yum更换vault地窖保险库过期源,epel的archive归档源 笔记241117

CentOS7.9.2009的yum更换vault地窖保险库过期源,epel的archive归档源 笔记241117

备份 /etc/yum.repos.d 文件夹

bash 复制代码
tempUri=/etc/yum.repos.d ;        sudo  cp    -a  $tempUri  $tempUri.$(date +%0y%0m%0d%0H%0M%0Sns%0N).bak

清空 /etc/yum.repos.d 文件夹

bash 复制代码
sudo rm -rf /etc/yum.repos.d/*

/etc/yum.repos.d 下,新建 xxx.repo 文件

名字随便取, 以.repo结尾 可以叫 CentOS-Base.repo , 也可以叫 a.repo

bash 复制代码
sudo vi /etc/yum.repos.d/CentOS-Base.repo

bash 复制代码
sudo vi /etc/yum.repos.d/a.repo

xxx.repo 文件内容如下

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.aliyun.com/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.huaweicloud.com/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.cloud.tencent.com/centos-vault/7.9.2009/os/$basearch/
    http://archive.kernel.org/centos-vault/7.9.2009/os/$basearch/
    http://linuxsoft.cern.ch/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.ustc.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.cqupt.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirror.nyist.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.pku.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirror.nsc.liu.se/centos-store/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.aliyun.com/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.huaweicloud.com/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.cloud.tencent.com/centos-vault/7.9.2009/updates/$basearch/
    http://archive.kernel.org/centos-vault/7.9.2009/updates/$basearch/
    http://linuxsoft.cern.ch/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.ustc.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.cqupt.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirror.nyist.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.pku.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirror.nsc.liu.se/centos-store/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.aliyun.com/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.huaweicloud.com/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.cloud.tencent.com/centos-vault/7.9.2009/extras/$basearch/
    http://archive.kernel.org/centos-vault/7.9.2009/extras/$basearch/
    http://linuxsoft.cern.ch/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.ustc.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.cqupt.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirror.nyist.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.pku.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirror.nsc.liu.se/centos-store/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7


[epel-archive]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel-archive/7.9/$basearch
	http://mirrors.aliyun.com/epel-archive/7.8/$basearch
	http://mirrors.aliyun.com/epel-archive/7/$basearch
	http://mirrors.aliyun.com/epel/7/$basearch
	https://archives.fedoraproject.org/pub/archive/epel/7/$basearch
    http://mirrors.cloud.tencent.com/epel-archive/7/$basearch
    http://repo.jing.rocks/fedora-buffet/archive/epel/7/$basearch
    http://archives.fedoraproject.org/pub/archive/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

保存退出后, 重建yum缓存

bash 复制代码
sudo yum clean all; sudo yum makecache;

一气呵成

bash 复制代码
###  备份
tempUri=/etc/yum.repos.d ;        sudo  cp    -a  $tempUri  $tempUri.$(date +%0y%0m%0d%0H%0M%0Sns%0N).bak

###   清空 `/etc/yum.repos.d` 文件夹
sudo rm -rf /etc/yum.repos.d/*

echo '
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.aliyun.com/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.huaweicloud.com/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.cloud.tencent.com/centos-vault/7.9.2009/os/$basearch/
    http://archive.kernel.org/centos-vault/7.9.2009/os/$basearch/
    http://linuxsoft.cern.ch/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.ustc.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.cqupt.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirror.nyist.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirrors.pku.edu.cn/centos-vault/7.9.2009/os/$basearch/
    http://mirror.nsc.liu.se/centos-store/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.aliyun.com/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.huaweicloud.com/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.cloud.tencent.com/centos-vault/7.9.2009/updates/$basearch/
    http://archive.kernel.org/centos-vault/7.9.2009/updates/$basearch/
    http://linuxsoft.cern.ch/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.ustc.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.cqupt.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirror.nyist.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirrors.pku.edu.cn/centos-vault/7.9.2009/updates/$basearch/
    http://mirror.nsc.liu.se/centos-store/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.aliyun.com/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.huaweicloud.com/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.cloud.tencent.com/centos-vault/7.9.2009/extras/$basearch/
    http://archive.kernel.org/centos-vault/7.9.2009/extras/$basearch/
    http://linuxsoft.cern.ch/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.ustc.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.cqupt.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirror.nyist.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirrors.pku.edu.cn/centos-vault/7.9.2009/extras/$basearch/
    http://mirror.nsc.liu.se/centos-store/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7


[epel-archive]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel-archive/7.9/$basearch
	http://mirrors.aliyun.com/epel-archive/7.8/$basearch
	http://mirrors.aliyun.com/epel-archive/7/$basearch
	http://mirrors.aliyun.com/epel/7/$basearch
	https://archives.fedoraproject.org/pub/archive/epel/7/$basearch
    http://mirrors.cloud.tencent.com/epel-archive/7/$basearch
    http://repo.jing.rocks/fedora-buffet/archive/epel/7/$basearch
    http://archives.fedoraproject.org/pub/archive/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7




'  >  /etc/yum.repos.d/CentOS-Base.repo 

sudo yum clean all ; sudo yum makecache;
相关推荐
bohu8335 分钟前
sentinel学习笔记5-资源指标数据统计
笔记·sentinel·statisticslot
璞~44 分钟前
MQTT 课程概览 (学习笔记)02
笔记·学习
小王爱吃月亮糖1 小时前
C++进阶-1-单继承、多继承、虚继承
开发语言·c++·笔记·学习·visual studio
小王爱吃月亮糖2 小时前
补充--C++的项目结构和管理
数据结构·c++·笔记·学习
CSND7402 小时前
Ubuntu vi(vim)编辑器配置一键补全main函数
linux·c语言·ubuntu·编辑器·vim
シ風箏5 小时前
Neo4j【环境部署 02】图形数据库Neo4j在Linux系统ARM架构下的安装使用
linux·数据库·arm·neo4j
Cachel wood7 小时前
Vue.js前端框架教程8:Vue消息提示ElMessage和ElMessageBox
linux·前端·javascript·vue.js·前端框架·ecmascript
小屁不止是运维9 小时前
麒麟操作系统服务架构保姆级教程(二)ssh远程连接
linux·运维·服务器·学习·架构·ssh
超爱吃士力架10 小时前
Ubuntu操作系统安装docker
linux·前端·后端
柳鲲鹏10 小时前
jiangdg/AndroidCamera关闭摄像头流程
笔记