• ubuntu中,出现Failed to fetch http://…..时,需要换源


    问题描述:出现Failed to fetch http://…..

     

    问题原因:一般是由于直接使用国外的源无法连接的原因导致的

     

    解决方案:直接替换成国内的源即可

                            (1)执行备份命令:sudo cp /etc/apt/sources.list /etc/apt/sources.list.old

                        (2)打开文件:sudo vim /etc/apt/sources.list

                        (3)换源:复制源覆盖文件原来的内容(根据自己的网去尝试,选择最快的一个)

            (4)更新源:sudo apt update        如果出现依赖问题-->sudo apt -f install

            (5)更新软件:sudo apt upgrade


    以下是ubuntu20.04版本软件源 [另附其他版本地址:阿里云开源镜像站: http://mirrors.aliyun.com/]

                                                                                   [清华大学:http://mirrors.tuna.tsinghua.edu.cn/  (IPv4+IPv6)]

                                                                                   [中科大:http://mirrors.ustc.edu.cn/  (IPv4+IPv6)]

    #添加阿里源

    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

    #添加清华源

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse

                                       

    作者:天际使徒
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    HTTP状态码
    firefox浏览器新建页面一直处于刷新状态解决方法
    firefox浏览器需要新建窗口时以新建标签页代替
    bash基础教程
    sqoop的导入|Hive|Hbase
    sqoop导出数据|Hive|HDFS和脚本编写
    sqoop安装
    sqoop简介和原理分析
    Oozie安装
    Oozie框架介绍
  • 原文地址:https://www.cnblogs.com/Horizon-asd/p/12595723.html
Copyright © 2020-2023  润新知