centos 镜像源_孩子镜像问题怎么解决

centos 镜像源_孩子镜像问题怎么解决CentOS8阿里新镜像源【旧的已经弃用】欢迎使用Markdown编辑器你好!这是你第一次使用Markdown编辑器所展示的欢迎页。如果你想学习如何使用Markdown编辑器,可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。新的改变我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功能,我们增加了如下几点新功能,帮助你用它写博客:全新的界面设计,将会带来全新的写作体验;在创作中心设置你喜爱的代码高亮样式,Markdown将代码片

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

CentOS8阿里新镜像源【解决阿里云路径弃用问题】

方案1(脚本中会清空yum.repo.d内的文件)

==防盗标识:本文源文地址,未授权禁止转载https://blog.csdn.net/weixin_44331765/article/details/123068623

  1. 创建一个脚本文件cetos.sh
  2. 写入以下内容
  3. 执行bash centos.sh即可
    
    #!/bin/bash
    cp -r /etc/yum.repo.d /etc/yum.repo.d.bak
    rm -rf /etc/yum.repo.d/*
    cat >> /etc/yum.repo.d/CentOS-Base.repo << EOF # 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-8.5.2111 - Base - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/BaseOS/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/BaseOS/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/BaseOS/\$basearch/os/ gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that may be useful [extras] name=CentOS-8.5.2111 - Extras - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/extras/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/extras/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/extras/\$basearch/os/ gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that extend functionality of existing packages [centosplus] name=CentOS-8.5.2111 - Plus - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/centosplus/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/centosplus/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/centosplus/\$basearch/os/ gpgcheck=0 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [PowerTools] name=CentOS-8.5.2111 - PowerTools - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/PowerTools/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/PowerTools/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/PowerTools/\$basearch/os/ gpgcheck=0 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [AppStream] name=CentOS-8.5.2111 - AppStream - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/AppStream/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/AppStream/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/AppStream/\$basearch/os/ gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official EOF
    
    yum clean all && yum makecache
    
    
    

方案2替换原有的路径

  1. 手动替换:
替换CentOS-Linux-AppStream.repo中的内容
1. 注释#mirrorlist=xxxxx
2. 启用baseurl=xxx,并把baseurl中的http路径修改为:baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/extras/$basearch/os/
3. 同理替换CentOS-Linux-BaseOS.repo中的mirrorlist=xxx和baseurl并把地址换了即可
  1. 脚本执行:执行方法同1
    centos.sh文件内容替换为
#!/bin/bash
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cat >> /etc/yum.repo.d/CentOS-Base.repo << EOF # 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-8.5.2111 - Base - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/BaseOS/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/BaseOS/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/BaseOS/\$basearch/os/ gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that may be useful [extras] name=CentOS-8.5.2111 - Extras - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/extras/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/extras/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/extras/\$basearch/os/ gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that extend functionality of existing packages [centosplus] name=CentOS-8.5.2111 - Plus - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/centosplus/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/centosplus/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/centosplus/\$basearch/os/ gpgcheck=0 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [PowerTools] name=CentOS-8.5.2111 - PowerTools - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/PowerTools/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/PowerTools/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/PowerTools/\$basearch/os/ gpgcheck=0 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [AppStream] name=CentOS-8.5.2111 - AppStream - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/AppStream/\$basearch/os/ http://mirrors.aliyuncs.com/centos-vault/8.5.2111/AppStream/\$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/AppStream/\$basearch/os/ gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official EOF
minorver=8.5.2111
sudo sed -e "s|^mirrorlist=|#mirrorlist=|g" \
-e "s|^#baseurl=http://mirror.centos.org/&dollar;contentdir/&dollar;releasever/AppStream/&dollar;basearch/os/|baseurl=http://mirrors.aliyun.com/centos-vault/$minorver/extras/$basearch/os/|g" \
-i.bak \
/etc/yum.repos.d/CentOS-Linux-AppStream.repo

sudo sed -e "s|^mirrorlist=|#mirrorlist=|g" \
-e "s|^#baseurl=http://mirror.centos.org/&dollar;contentdir/&dollar;releasever/BaseOS/&dollar;basearch/os/|baseurl=http://mirrors.aliyun.com/centos-vault/$minorver/extras/$basearch/os/|g" \
-i.bak \
/etc/yum.repos.d/CentOS-Linux-BaseOS.repo
dnf clean all
dnf makecache

参考连接1
参考连接2

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

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/179217.html原文链接:https://javaforall.net

(0)
上一篇 2022年8月30日 上午10:16
下一篇 2022年8月30日 上午10:16


相关推荐

  • 开源网管软件_网关开发

    开源网管软件_网关开发让你不差钱的9款开源网管工具(组图)http://network.51cto.com/art/200906/129490.htm 转载于:https://blog.51cto.com/zgxworks/167764

    2026年4月15日
    4
  • verilog语言转vhdl语言_vhdl转换为verilog

    verilog语言转vhdl语言_vhdl转换为verilog1.下载后先运行X-HDL-4.2.1-Setup.exe文件,选择安装路径,注意路径中不要有中文。2.运行crack_xhdl_4.2.1.exe文件,选择刚刚你安装XHDL的路径下的\bin文件夹,点击next—finish,出现success代表激活成功教程成功。3.可能会要求你重启电脑,这时候同意重启就好了。4.重启之后运行X-HDL。5.可以选择VHDL转Verilog或Verilog转…

    2026年2月7日
    4
  • linux 设置环境变量

    linux 设置环境变量这里常用的方法无非就是 2 种 第一种是通过 export 方法来导入环境变量 例如 exportLD LIBRARY PATH LD LIBRARY PATH ymk test python3 8 esx64 cayman lib build toolchain lin64 openssl 1 0 2p lib 这种方式的特点是 1 只在当前链接下生效 退出后再登录就没了 就是临时用 一次性的 2 然后他的作用域是当前用户 如果当前用户为一般用户 那么加

    2026年3月17日
    2
  • Vue 父组件向子组件传递动态参数,子组件如何实时更新[通俗易懂]

    项目问题介绍:父组件中填入各种查询条件,点击查询按钮查出符合条件的数据。其中,数据列表是引入的子组件。第一次加载的时候,子组件数据正常显示,再次查询的时候子组件怎么实现实时更新呢?解决办法:子组件watch中(监听)父组件数据的变化以自己的项目为例:父组件:这是父组件中如何引用的子组件。testParams是我需要传过去的参数对象。参数名是params。子组…

    2022年4月13日
    259
  • webpackdevtool配置简单对比简书_钢铁雄心4toolpackMOD

    webpackdevtool配置简单对比简书_钢铁雄心4toolpackMOD作用:webpack会将js代码进行压缩打包,loader也会处理相应代码,打包后代码很难进行查看,这也使得开发人员调试时很难找到对应代码位置。此时可采用devtool,通过资源地图的方式,给出打包后代码到原始代码的映射,方便开发人员调试。要点:webpack官方给出了多种模式,模式间主要区别以及应用场景已经给出,下面是主要参考参数参数名参数描述参数值devtool可以使用的devtool根据基础模式可自行组合,基础模式有:(eval、cheap、module、inli.

    2022年10月5日
    7
  • 腾讯混元OCR模型API接口调用教程:vLLM与PyTorch双模式支持

    腾讯混元OCR模型API接口调用教程:vLLM与PyTorch双模式支持

    2026年3月12日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号