美文网首页
CentOS 8 停止更新后的 yum / dnf 备用源配置

CentOS 8 停止更新后的 yum / dnf 备用源配置

作者: 田丰w | 来源:发表于2022-04-25 12:35 被阅读0次

对于阿里云 ECS 机器

# 在 root 帐号下操作

# 备份之前的repo文件
rename '.repo' '.repo.bak' /etc/yum.repos.d/CentOS*.repo

# 下载最新的repo文件
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo

# 替换repo文件中的链接
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g'  /etc/yum.repos.d/Centos-vault-8.5.2111.repo &&  sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo

# 重新创建缓存
yum clean all && yum makecache

如果服务器不是ECS实例,需保证服务器具有公网访问能力,并且源地址 http://mirrors.cloud.aliyuncs.com 需要替换为http://mirrors.aliyun.com 。例如,切换yum源为 http://mirrors.aliyun.com/centos-vault/8.5.2111/ ;切换epel源为 http://mirrors.aliyun.com/epel-archive/8/

参考

https://help.aliyun.com/document_detail/405635.html

相关文章

  • CentOS 8 停止更新后的 yum / dnf 备用源配置

    对于阿里云 ECS 机器 如果服务器不是ECS实例,需保证服务器具有公网访问能力,并且源地址 http://mir...

  • yum源的配置

    centos7yum源配置 本地yum源 网络yum源vim CentOS-Base.repo 后续会更新ubun...

  • CouchDB入门

    配置yum源 在CentOS8上默认的yum源是没有couchdb包的,因此需要添加couchdb的yum源。创建...

  • Centos Issue

    CentOS配置本地Yum源、阿里云Yum源、163Yum源、并配置Yum源的优先级

  • 常用yum源介绍及配置

    参考: CentOS 7下配置本地yum源及yum客户端 Centos7 配置本地源+阿里yum源/epel-yu...

  • CentOS 8.x系统yum报404的解决方法

    报错问题 出现这个的原因背景 CentOS 8.x停止维护了,顺带他的yum源也停止了,国内的同步的yum源同步也...

  • npm与yarn

    一、镜像源加速 二、安装dnf dnf 与 yum 用法基本一致,DNF并未默认安装在RHEL或CentOS7系统...

  • k8s 安装过程记录

    环境配置 vmware安装centos 7虚拟机 yum安装wget,setup ,perl 更新yum镜像源 d...

  • php5.6 install

    配置yum源 追加CentOS 6.5的epel及remi源。 以下是CentOS 7.0的源。 使用yum li...

  • chrome的更新与启动

    centos7 更新Chrome 1.配置yum下载源: 在目录 /etc/yum.repos.d/ 下新建文件 ...

网友评论

      本文标题:CentOS 8 停止更新后的 yum / dnf 备用源配置

      本文链接:https://www.haomeiwen.com/subject/tsufyrtx.html