ubuntu apt update failed to fetch
When I do command sudo apt update, always get belowing errors:
- Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
- Could not connect to archive.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused)
- Err:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
- Unable to connect to archive.ubuntu.com:http:
- Err:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
- Unable to connect to archive.ubuntu.com:http:
- Err:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
- Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
- Reading package lists... Done
- Building dependency tree
- Reading state information... Done
- All packages are up to date.
- W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Could not connect to archive.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused)
- W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Unable to connect to archive.ubuntu.com:http:
- W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Unable to connect to archive.ubuntu.com:http:
- W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
- W: Some index files failed to download. They have been ignored, or old ones used instead.
and I have done my proxy setting in file .bash_profile like:
- function setproxy
- {
- export {http,ftp}_proxy=xx.yy.com:80
- }
- function unsetproxy
- {
- unset {http,ftp}_proxy
- }
- setproxy
and check it with command env | grep -i proxy:
- kay@cn:~$ env | grep -i proxy
- http_proxy=xx.yy.com:80
- ftp_proxy=xx.yy.com:80
At last, I found what I should do is to create an apt proxy conf file.
Apt loads all configuration files under /etc/apt/apt.conf.d. We can create a configuration specifically for our proxy there, keeping it separate from all other configurations.
- Create a new configuration file named proxy.conf.
- sudo touch /etc/apt/apt.conf.d/proxy.conf
- Open the proxy.conf file in a text editor.
- sudo vi /etc/apt/apt.conf.d/proxy.conf
- Add the following line to set your HTTP proxy.
- Acquire::http::Proxy "http://user:password@proxy.server:port/";
- Add the following line to set your HTTPS proxy.
- Acquire::https::Proxy "http://user:password@proxy.server:port/";
- Save your changes and exit the text editor.
Your proxy settings will be applied the next time your run Apt.
ubuntu apt update failed to fetch的更多相关文章
- Ubuntu apt update卡在Connecting to security.ubuntu.com解决方法
Ubuntu操作系统运行apt update命令时会卡在Connecting to security.ubuntu.com,搭了梯子也无法解决 尝试了网络上的方法,如: https://blog.cs ...
- ubuntu apt update时W: GPG error http://ppa.launchpad.net lucid Release没有公钥无法验证NO_PUBKEY签名问题解决
在安装更新时,即在运行命令行sudo apt-get update 或者运行更新管理器的时候,出现W: GPG 错误: W: GPG error: http://ppa.launchpad.net/o ...
- ubuntu 执行apt-get update报错Failed to fetch
在ubuntu下执行sudo apt-get update时,经常会遇到报错: Err http://security.ubuntu.com precise-security InRelease Er ...
- 【转】ubuntu apt-get update 失败解决
FROM : http://blog.csdn.net/ronghua_liu/article/details/8609450 当运行apt-get update后出现如下错误时:E: Some in ...
- [置顶]
ubuntu版本很老,apt-get update更新失败时(W: Failed to fetch ...)------如何创建新的sources.list
在说这个解决方案之前,我先说下,目前遇到的问题: 我使用 sudo apt-get update 之后,更新失败.具体原因如下: W: Failed to fetch http://cn.archiv ...
- Ubuntu sudo apt-get update提示 Failed to fetch,解决办法
问题: 执行sudo apt-get update提示:Failed to fetch chen@ubuntu:~/soft/Python-$ sudo apt-get update Get: htt ...
- apt-get update --> Bad header line (fresh install) Ign http://archive.ubuntu.com natty-security/multiverse Sources/DiffIndex W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/natty/Rele
apt-get update --> Bad header line (fresh install) fresh natty install i386 desktop. I get this e ...
- [置顶]
apt-get update 更新失败----如何清除破损而且陈旧的PPA仓库 (W: Failed to fetch http://ppa.launchpad.net/jonathonf/pyt)
我使用sudo apt-get update之后,更新失败,遇到如下错误. W: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3 ...
- ubuntu 更新源 或者 apt-get install 出错404 not found ,Failed to fetch
1.考虑是不是能上网 2.用apt-get update ,然后再试试apt-get install 如果apt-get update 也出现很多 404 not found 或者 failed to ...
随机推荐
- Spring Boot Security 整合 JWT 实现 无状态的分布式API接口
简介 JSON Web Token(缩写 JWT)是目前最流行的跨域认证解决方案.JSON Web Token 入门教程 - 阮一峰,这篇文章可以帮你了解JWT的概念.本文重点讲解Spring Boo ...
- 享元模式 FlyWeight 结构型 设计模式(十五)
享元模式(FlyWeight) “享”取“共享”之意,“元”取“单元”之意. 意图 运用共享技术,有效的支持大量细粒度的对象. 意图解析 面向对象的程序设计中,一切皆是对象,这也就意味着系统的运行将 ...
- html&css学习一
HTML标签 HTML骨架 <HTML> <head> <title></title> </head> <body> </ ...
- jsp内置对象-application对象
隐含对象application是javax.servlet.ServletContext接口实现类的对象,其拥有application的作用范围,即application可以用于在多个用户之间保存数据 ...
- 虹软免费人脸识别SDK注册指南
成为开发者三步完成账号的基本注册与认证:STEP1:点击注册虹软AI开放平台右上角注册选项,完成注册流程.STEP2:首次使用,登录后进入开发者中心,点击账号管理完成企业或者个人认证,若未进行实名认证 ...
- 简单的C#实体映射 AutoMapper
AutoMapper是对象到对象的映射工具.在完成映射规则之后,AutoMapper可以将源对象转换为目标对象. 要映射实体 public class SourceModel { public int ...
- anaconda的scikit-learn报错It seems that scikit-learn has not been built
我们在导入sklearn时往往会报错. import sklearn Traceback (most recent call last): File "<stdin>" ...
- 光盘安装win7系统教程
光盘安装系统是最传统的安装系统的方法,虽然现在U盘安装和硬盘安装已经很方便,但仍有很多用户习惯光盘安装的方式,下面小编教大家如何利用光盘安装系统. 来源:https://www.haoxitongx. ...
- UOJ #269. 【清华集训2016】如何优雅地求和
UOJ #269. [清华集训2016]如何优雅地求和 题目链接 给定一个\(m\)次多项式\(f(x)\)的\(m+1\)个点值:\(f(0)\)到\(f(m)\). 然后求: \[ Q(f,n,x ...
- 好程序员告诉你HTML好在哪里,为什么值得我们学习
好程序员告诉你HTML好在哪里,为什么值得我们学习,HTML5对于用户来说,提高了用户体验,加强了视觉感受.HTML5技术在移动端,能够让应用程序回归到网页,并对网页的功能进行扩展,用户不需要下载客户 ...