centos6停止yum维护解决办法

阿里云:http://mirrors.aliyun.com/centos-vault/6.5
在此安装的是centos6.5最小系统
修改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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates 
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
yum install wget zip unzip lrzsz
yum install gettext

yum install perl-ExtUtils-MakeMaker package
yum install gcc gcc-c++ autoconf automake libtool
yum install libcurl-devel curl-devel kernel-headers zlib-devel 

国内镜像站点

https://www.cnblogs.com/shijunxian/archive/2020/05/11/12864691.html

国外

https://vault.centos.org/6.5
http://archive.kernel.org/centos-vault/6.5
cd /etc/yum.repos.d/
mv CentOS-Base.repo   CentOS-Base.repo_old
vi CentOS-Base.repo

以下是centos7
修改为

# 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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.neusoft.edu.cn/centos/7/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates 
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.neusoft.edu.cn/centos/7/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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.neusoft.edu.cn/centos/7/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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.neusoft.edu.cn/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirrors.neusoft.edu.cn/centos/7/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum clean all
yum makecache
### CentOS 7 停止维护后的 YUM 源替代方案及更新方法 当 CentOS 7 进入维护模式后,官方将不再提供新的包和安全更新。为了继续获得必要的软件和支持,可以考虑以下几个替代方案: #### 使用第三方仓库 一些社区和个人提供了持续维护的第三方仓库来代替官方已停止服务的镜像站点。 - **Vault 镜像库**:Red Hat 继续在其 Vault 存储库中保留旧版本的内容直到生命周期结束。可以通过修改 `/etc/yum.repos.d/CentOS-Vault.repo` 文件指向 vault.centos.org 来访问这些资源[^1]。 ```bash baseurl=http://vault.centos.org/$releasever/os/$basearch/ ``` - **Rocky Linux 或 AlmaLinux**:这两个项目旨在成为完全兼容的 CentOS 替代品,在 CentOS EOL 后仍然保持活跃开发并定期发布更新。用户可以选择切换至其中一个发行版以享受更长时间的支持和服务[^2]。 #### 修改现有配置文件 对于希望留在当前操作系统而不做大规模迁移的企业来说,调整现有的 `yum` 配置也是一种可行的选择。 通过编辑位于 `/etc/yum.repos.d/` 下的相关 `.repo` 文件中的 URL 地址字段 (`baseurl`) ,将其改为其他可信赖且仍在运营的服务提供商所提供的链接即可实现这一目的。例如: ```bash sudo sed -i 's|^mirrorlist=|#mirrorlist=|' /etc/yum.repos.d/CentOS-Base.repo sudo sed -i 's|^#baseurl=https\?://mirror.centos.org|baseurl=http://archive.kernel.org/centos-vault|' /etc/yum.repos.d/CentOS-Base.repo ``` 上述命令会禁用默认使用的 mirrorlist 方式转而采用固定的 baseurl 获取数据流;这里选用的是 kernel archive 上托管的历史存档作为新来源之一[^3]。 完成更改之后记得运行 `yum clean all && yum makecache` 刷新缓存确保一切正常工作。 ---
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值