首页 > 系统相关 >CentOS 7.9 停止维护(2024-6-30)后可用在线yum源 —— 筑梦之路

CentOS 7.9 停止维护(2024-6-30)后可用在线yum源 —— 筑梦之路

时间:2024-07-07 12:56:17浏览次数:21  
标签:epel repo centos CentOS 30 cat 2024 yum

众所周知,centos 7 在2024年6月30日,生命周期结束,官方不再进行支持维护,而很多环境一时之间无法完全更新替换操作系统,因此对于yum源还是需要的,特别是对于互联网环境来说,在线yum源使用方便很多,而不需要去搭建本地yum源和内网yum源。

这里以阿里云为例,其他国内开源镜像站类似。此处主要以7.9为例。

1. 备份默认的repo文件

cd /etc/yum.repos.d

mkdir backup

mv *.repo backup

2.配置阿里云的yum源

cat > CentOS-aliyun-lhr.repo << 'EOF'
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
EOF
cat > epel-aliyun.repo <<'EOF'
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
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.aliyun.com/epel/7/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0
 
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0
EOF

 3. 检查验证

yum  clean all

yum makecache fast


yum install vim lrzsz wget curl net-tools 

4. 其他可用yum源搜集

1)官方yum源

cat > CentOS-Base.repo <<'EOF'
[base]
name=CentOS-7.9.2009
enabled=1
failovermethod=priority
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-7.9.2009
enabled=1
failovermethod=priority
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-7.9.2009
enabled=1
failovermethod=priority
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-7
EOF

 2)官方epel扩展源

cat > epel.repo <<'EOF'
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=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://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=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://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=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
EOF
cat > epel-testing.repo <<'EOF'
[epel-testing]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-testing-source]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/testing/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
EOF

3) 清华大学yum源

cat > CentOS-tsinghua.repo <<'EOF'
[base]
name=CentOS-7.9.2009
enabled=1
failovermethod=priority
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-7.9.2009
enabled=1
failovermethod=priority
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-7.9.2009
enabled=1
failovermethod=priority
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-7
[epel]
name=Extra Packages for Enterprise Linux 7 - 
enabled=1
failovermethod=priority
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/
gpgcheck=0
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/epel/RPM-GPG-KEY-EPEL-7
EOF

4)中科大yum源

cat > CentOS-ustc.repo <<'EOF'
[base]
name=CentOS- - Base
baseurl=https://mirrors.ustc.edu.cn/centos-vault/centos/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS- - Updates
baseurl=https://mirrors.ustc.edu.cn/centos-vault/centos/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS- - Extras
baseurl=https://mirrors.ustc.edu.cn/centos-vault/centos/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS- - Plus
baseurl=https://mirrors.ustc.edu.cn/centos-vault/centos/7.9.2009/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
EOF

5)网易yum源

cat > CentOS-163.repo <<'EOF'
[base]
name=CentOS-$releasever - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos-vault/7.9.2009/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

EOF

其他centos版本的yum源配置:

CentOS 6 在线可用yum源配置——筑梦之路_centos6可用yum源-CSDN博客

CentOS 8 停止维护后换可用yum源——筑梦之路_centos yum 阿里云镜像还支持吗-CSDN博客

参考资料:

https://www.cnblogs.com/yeziwinone/p/17916626.html

centos镜像_centos下载地址_centos安装教程-阿里巴巴开源镜像站

标签:epel,repo,centos,CentOS,30,cat,2024,yum
From: https://blog.csdn.net/qq_34777982/article/details/140119407

相关文章

  • 逐月信息学 2024 提高组 #4
    \(\color{black}\texttt{A.转盘锁}\)题目描述给定一个四位转盘锁,每个转盘上都有\(0\)到\(9\)的数字。数字\(i\)的下一个数字是\((i+1)\bmod10\),上一个数字是\((i-1)\bmod10\)。每次你可以将一段连续的区间全部往上翻或往下翻一个数字。现在给定一个初始时的转盘,求最......
  • 2024暑假南京外国语学校c++集训 20240706 测试(J/S-)
    A笔记本电脑第一题没啥好说的了点击查看代码#include<bits/stdc++.h>usingnamespacestd;intn;set<int>t;pair<int,int>arr[100009];intmain(){ ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); cin>>n; for(inti=1;i<=n;i++) { cin>>......
  • EasyRecovery2024最新软件永久破解激活码
    该软件的界面设计直观明了,用户可以轻松找到所需的功能选项。在软件首页,用户可以看到多个分区恢复选项,如硬盘分区、外接盘区、常用区域等,只需勾选文件丢失的原始位置,然后点击“开始扫描”即可。扫描完成后,用户可以在左侧边栏看到文件的目录,右侧则可以进行文件的勾选和预览。最后......
  • 会声会影2024官方破解版下载全攻略方法教程最新
    《会声会影2024破解版》是一款流行的视频编辑软件,其正式版通常需付费使用。然而,由于正版费用较高,一些用户可能寻求破解版以免费享受该软件的全部功能。这种需求反映了普通用户在面对昂贵软件时的经济考量与版权意识之间的冲突。会声会影全版本绿色安装包获取链接:(抓紧保存以防......
  • KubeSphere 社区双周报|2024.06.21-07.04
    KubeSphere社区双周报主要整理展示新增的贡献者名单和证书、新增的讲师证书以及两周内提交过commit的贡献者,并对近期重要的PR进行解析,同时还包含了线上/线下活动和布道推广等一系列社区动态。本次双周报涵盖时间为:2024.06.21-07.04。贡献者名单新晋KubeSpherecontribu......
  • python-graph-study2024-7
     1.先打基础1基础学习笔记 GraphCreationNetworkXgraphobjectscanbecreatedinoneofthreeways:Graphgenerators—standardalgorithmstocreatenetworktopologies.Importingdatafrompreexisting(usuallyfile)sources.Addingedgesan......
  • Denso Create Programming Contest 2024(AtCoder Beginner Contest 361)
    DensoCreateProgrammingContest2024(AtCoderBeginnerContest361)\(A\)Insert\(AC\)循环结构。点击查看代码inta[200];intmain(){intn,k,x,i;cin>>n>>k>>x;for(i=1;i<=n;i++){cin>>a[i];cout......
  • [SNCPC2024] 2024 年陕西省大学生程序设计 J题猜质数II 题解
    题目链接:CF或者洛谷PS:CF的得等上gym。前提说明其实在上个月就见到这题了,当时很想做这题,结果找不到做题链接,也不知道出处,原来是陕西省赛的捧杯题。个人评价觉得是一道很不错的题,难度适中。讲解其实题解写的挺不错的,比很多比赛的题解写的详细许多了。这里站在我的角度分......
  • 2024.7.6
    java流式streamflitermapskipforeachcollect...sparkstream关闭方法publicclassSparkStreaming08_Close_1{publicstaticvoidmain(String[]args)throwsException{SparkConfconf=newSparkConf();conf.setMaster("local[*]&quo......
  • 安装MySQL(Windows10和Linux CentOS7) 很详细的
    Windows10下安装MySQL1.下载MySQL官网下载MySQL:https://www.mysql.com/进入官网点击DOWNLOADS下滑点击MySQLCommunity(GPL)Downloads点击MySQLInstallerforWindows选择版本下载这里就不需要登录注册了,直接下载2.安装MySQL找到下载的文件双击之后选择Se......