当前位置: 代码网 > 服务器>软件设计>开源 > CentOS 7.9 停止维护(2024-6-30)后可用在线yum源 —— 筑梦之路

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

2024年07月31日 开源 我要评论
众所周知,centos 7 在2024年6月30日,生命周期结束,官方不再进行支持维护,而很多环境一时之间无法完全更新替换操作系统,因此对于yum源还是需要的,特别是对于互联网环境来说,在线yum源使用方便很多,而不需要去搭建本地yum源和内网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安装教程-阿里巴巴开源镜像站

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com