zoukankan      html  css  js  c++  java
  • 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

                                       

    作者:天际使徒
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    用C#实现宽带重新拨号
    CALLBACK FUNCTION 回调函数
    编译程序 VS 解释程序
    《围城》读书笔记
    鼠标点击器
    工作与找工作的日子
    Windows 7下VS2003的查找无响应问题
    收藏几句关于程序的名言
    static知识小结
    如何定义和实现一个类的成员函数为回调函数(转)
  • 原文地址:https://www.cnblogs.com/Horizon-asd/p/12595723.html
Copyright © 2011-2022 走看看