ubuntu18.04 apt update失败问题

2024-06-17 15:48

本文主要是介绍ubuntu18.04 apt update失败问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

问题现象
 

Err:1 http://us.mirrors.ustc.edu.cn/ubuntu bionic InReleaseConnection failed [IP: 202.141.176.110 80]Err:2 http://us.mirrors.ustc.edu.cn/ubuntu bionic-updates InReleaseConnection failed [IP: 202.141.176.110 80]Err:3 http://us.mirrors.ustc.edu.cn/ubuntu bionic-backports InReleaseConnection failed [IP: 202.141.176.110 80]Hit:4 http://security.ubuntu.com/ubuntu bionic-security InReleaseReading package lists... DoneBuilding dependency treeReading state information... Done186 packages can be upgraded. Run 'apt list --upgradable' to see them.W: Failed to fetch http://us.mirrors.ustc.edu.cn/ubuntu/dists/bionic/InRelease Connection failed [IP: 202.141.176.110 80]W: Failed to fetch http://us.mirrors.ustc.edu.cn/ubuntu/dists/bionic-updates/InRelease Connection failed [IP: 202.141.176.110 80]W: Failed to fetch http://us.mirrors.ustc.edu.cn/ubuntu/dists/bionic-backports/InRelease Connection failed [IP: 202.141.176.110 80]W: Some index files failed to download. They have been ignored, or old ones used instead.

看了某大佬的博客,发现是ubuntu的源有问题,更换成阿里云的源,果然可以使用了

具体步骤:1.sudo vi /etc/apt/sources.list ,(保险起见备份该文件)替换内容如下

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse#centos源(放心使用):deb http://centos.bitcomm.cn/ubuntu trusty main restricted universe multiversedeb http://centos.bitcomm.cn/ubuntu trusty-security main restricted universe multiversedeb http://centos.bitcomm.cn/ubuntu trusty-updates main restricted universe multiversedeb http://centos.bitcomm.cn/ubuntu trusty-backports main restricted universe multiversedeb http://centos.bitcomm.cn/ubuntu trusty-proposed main restricted universe multiversedeb-src http://centos.bitcomm.cn/ubuntu trusty main restricted universe multiversedeb-src http://centos.bitcomm.cn/ubuntu trusty-security main restricted universe multiversedeb-src http://centos.bitcomm.cn/ubuntu trusty-updates main restricted universe multiversedeb-src http://centos.bitcomm.cn/ubuntu trusty-backports main restricted universe multiversedeb-src http://centos.bitcomm.cn/ubuntu trusty-proposed main restricted universe multiverse

2.保存,退出,重新sudo apt update

 

/etc/resolv.conf 里面添加这个服务地址

nameserver 127.0.0.53 

或者 nameserver 8.8.8.8

 

 

18.10版本可以使用下面的源

# 默认注释了源码镜像以提高 apt update 速度(未认证)
deb http://old-releases.ubuntu.com/ubuntu/ cosmic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ cosmic main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ cosmic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ cosmic-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ cosmic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ cosmic-backports main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ cosmic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ cosmic-security main restricted universe multiverse# 预发布软件源(可有可无)
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ cosmic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ cosmic-proposed main restricted universe multiverse~                    

 

 

 


https://blog.csdn.net/weixin_38707040/article/details/97133100?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

这篇关于ubuntu18.04 apt update失败问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/1069871

相关文章

MySQL启动报错:InnoDB表空间丢失问题及解决方法

《MySQL启动报错:InnoDB表空间丢失问题及解决方法》在启动MySQL时,遇到了InnoDB:Tablespace5975wasnotfound,该错误表明MySQL在启动过程中无法找到指定的s... 目录mysql 启动报错:InnoDB 表空间丢失问题及解决方法错误分析解决方案1. 启用 inno

Java使用MethodHandle来替代反射,提高性能问题

《Java使用MethodHandle来替代反射,提高性能问题》:本文主要介绍Java使用MethodHandle来替代反射,提高性能问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑... 目录一、认识MethodHandle1、简介2、使用方式3、与反射的区别二、示例1、基本使用2、(重要)

电脑蓝牙连不上怎么办? 5 招教你轻松修复Mac蓝牙连接问题的技巧

《电脑蓝牙连不上怎么办?5招教你轻松修复Mac蓝牙连接问题的技巧》蓝牙连接问题是一些Mac用户经常遇到的常见问题之一,在本文章中,我们将提供一些有用的提示和技巧,帮助您解决可能出现的蓝牙连接问... 蓝牙作为一种流行的无线技术,已经成为我们连接各种设备的重要工具。在 MAC 上,你可以根据自己的需求,轻松地

Java 中的跨域问题解决方法

《Java中的跨域问题解决方法》跨域问题本质上是浏览器的一种安全机制,与Java本身无关,但Java后端开发者需要理解其来源以便正确解决,下面给大家介绍Java中的跨域问题解决方法,感兴趣的朋友一起... 目录1、Java 中跨域问题的来源1.1. 浏览器同源策略(Same-Origin Policy)1.

如何清理MySQL中的binlog问题

《如何清理MySQL中的binlog问题》:本文主要介绍清理MySQL中的binlog问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目http://www.chinasem.cn录清理mysql中的binlog1.查看binlog过期时间2. 修改binlog过期

如何解决yum无法安装epel-release的问题

《如何解决yum无法安装epel-release的问题》:本文主要介绍如何解决yum无法安装epel-release的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不... 目录yum无法安装epel-release尝试了第一种方法第二种方法(我就是用这种方法解决的)总结yum

IDEA下"File is read-only"可能原因分析及"找不到或无法加载主类"的问题

《IDEA下Fileisread-only可能原因分析及找不到或无法加载主类的问题》:本文主要介绍IDEA下Fileisread-only可能原因分析及找不到或无法加载主类的问题,具有很好的参... 目录1.File is read-only”可能原因2.“找不到或无法加载主类”问题的解决总结1.File

idea中project的显示问题及解决

《idea中project的显示问题及解决》:本文主要介绍idea中project的显示问题及解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录idea中project的显示问题清除配置重China编程新生成配置总结idea中project的显示问题新建空的pr

redis在spring boot中异常退出的问题解决方案

《redis在springboot中异常退出的问题解决方案》:本文主要介绍redis在springboot中异常退出的问题解决方案,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴... 目录问题:解决 问题根源️ 解决方案1. 异步处理 + 提前ACK(关键步骤)2. 调整Redis消费者组

Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题

《Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题》:本文主要介绍Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未... 目录一、前言二、系统架构检测三、卸载旧版 Go四、下载并安装正确版本五、配置环境变量六、验证安装七、常见