• centos6 yum源失效的最新操作方式,解决:[Errno 14] PYCURL ERROR 22


    参考链接: https://wiki.centos.org/zh/About/Product

    尝试了163、清华源、都不行

    阿里源也整了半天才在最下面的相关链接发现能找到源的地址 https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11shelh6

    备份

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
    

    下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

    wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
    

    替换源文件配置, 使用https://mirrors.aliyun.com/centos-vault/
    官方: 非阿里云ECS用户会出现 Couldn’t resolve host ‘mirrors.cloud.aliyuncs.com’ 信息,不影响使用。用户也可自行修改相关配置: eg:

    sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
    

    替换http成https

    sed -i  's/http/https/g' /etc/yum.repos.d/CentOS-Base.repo
    

    替换版本,$releasever替换6.8, 6.8是我用的版本

    sed -i  's/$releasever/6.8/g' /etc/yum.repos.d/CentOS-Base.repo
    

    替换centos为centos-vault

    sed -i  's/centos/centos-vault/g' /etc/yum.repos.d/CentOS-Base.repo
    yum clean all && yum makecache
    [root@hadoop101 yum.repos.d]# yum clean all && yum makecache
    已加载插件:fastestmirror, refresh-packagekit, security
    Cleaning repos: base extras updates
    清理一切
    Cleaning up list of fastest mirrors
    已加载插件:fastestmirror, refresh-packagekit, security
    Determining fastest mirrors
    base                                                     | 3.7 kB     00:00     
    base/group_gz                                            | 226 kB     00:00     
    base/filelists_db                                        | 6.4 MB     00:01     
    base/primary_db                                          | 4.7 MB     00:00     
    base/other_db                                            | 2.8 MB     00:00     
    extras                                                   | 3.4 kB     00:00     
    extras/filelists_db                                      |  38 kB     00:00     
    extras/prestodelta                                       | 1.3 kB     00:00     
    extras/primary_db                                        |  37 kB     00:00     
    extras/other_db                                          |  51 kB     00:00     
    updates                                                  | 3.4 kB     00:00     
    updates/filelists_db                                     | 3.5 MB     00:00     
    updates/prestodelta                                      | 390 kB     00:00     
    updates/primary_db                                       | 5.4 MB     00:01     
    updates/other_db                                         |  74 MB     00:12     
    元数据缓存已建立
    [root@hadoop101 yum.repos.d]# 
    

    ————————————————
    版权声明:本文为CSDN博主「新月爱文宇」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_37746897/article/details/110759717

  • 相关阅读:
    DS博客作业03--树
    C博客作业05--指针
    C博客作业04--数组
    C博客作业03--函数
    C博客作业02--循环结构
    顺序分支结构
    我的第一篇博客
    第1次任务:购物车程序的面向对象设计
    5-互评-OO之接口-DAO模式代码阅读及应用
    第三周-面向对象基础与类的识别-自主学习任务
  • 原文地址:https://www.cnblogs.com/netflix/p/15875183.html
Copyright © 2020-2023  润新知