apt get update无法正常使用解决方案(转载)
apt get update无法正常使用
解决方法参考博客
[问题描述]
前几天执行apt相关命令(如apt-get update),都会长时间停在``等待报头'',超时后,显示连接超时。
换了快速指南上提到的所有源,但是依然没有效果
今天执行的时候,打印出了如下信息:
代码: 全选
$ sudo apt-get update
错误 http://archive.ubuntu.com gutsy Release.gpg
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy/main Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy/restricted Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy/universe Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy/multiverse Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-security Release.gpg
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-security/main Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-security/restricted Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-security/universe Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-security/multiverse Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-updates Release.gpg
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-updates/main Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-updates/restricted Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-updates/universe Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-updates/multiverse Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-proposed Release.gpg
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-proposed/main Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-proposed/restricted Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-proposed/universe Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-proposed/multiverse Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://packages.medibuntu.org gutsy Release.gpg
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://packages.medibuntu.org gutsy/free Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://packages.medibuntu.org gutsy/non-free Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-backports Release.gpg
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-backports/main Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-backports/restricted Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-backports/universe Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
错误 http://archive.ubuntu.com gutsy-backports/multiverse Translation-zh_CN
无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy/Release.gpg 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy/main/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy/restricted/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy/universe/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy/multiverse/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-security/Release.gpg 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-security/main/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-security/restricted/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-security/universe/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-security/multiverse/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-updates/Release.gpg 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-updates/main/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-updates/restricted/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-updates/universe/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-updates/multiverse/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-proposed/Release.gpg 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-proposed/main/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-proposed/restricted/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-proposed/universe/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-proposed/multiverse/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-backports/Release.gpg 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-backports/main/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-backports/restricted/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-backports/universe/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://archive.ubuntu.com/ubuntu/dists/gutsy-backports/multiverse/i18n/Translation-zh_CN.bz2 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://packages.medibuntu.org/dists/gutsy/Release.gpg 无法连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://packages.medibuntu.org/dists/gutsy/free/i18n/Translation-zh_CN.bz2 无法连接 上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
无法下载 http://packages.medibuntu.org/dists/gutsy/non-free/i18n/Translation-zh_CN.bz2 无法 连接上 localhost:4001 (127.0.0.1)。 - connect (111 Connection refused)
正在读取软件包列表... 完成
W: 有一些索引文件不能下载,它们可能被忽略了,也可能转而使用了旧的索引文件。
$
上网google,发现了类似的问题:
viewtopic.php?t=80237&sid=a94bef5d612a8 ... 2c437fce7f
[网络环境]
普通家庭网络,通过路由上网,路由器通过PPPoE与因特网连接。没有对外连接的限制。未开防火墙。没有代理
[尝试措施]
o 把source.list中的域名部分,换成了IP,即,把archive.ubuntu.com换成了91.189.88.45,症状依旧
o 禁用了IPv6,症状依旧
[相关资料]
source.list放在了附件中
该问题已经解决,解决方案如下
[解决方案]
感谢BigSnake.NET
首先检测是否设置了http代理。检测方法:
代码: 全选
env | grep -i proxy
如果设置了代理,会出现:
代码: 全选
$ env | grep -i proxy
http_proxy=http://localhost:4001
HTTP_PROXY=http://localhost:4001
$
此时,删除这两个环境变量,bash下输入:
代码: 全选
unset http_proxy
unset HTTP_PROXY
最后,从配置文件里面把这两个环境变量彻底删除。通常会在/etc/environment里面
代码: 全选
sudo gedit /etc/environment
删除包含
http_proxy
或
HTTP_PROXY
的行
apt get update无法正常使用解决方案(转载)的更多相关文章
- Mac OSX系统homebrew update Fetching failed问题解决方案
1. brew update error (i) 问题出现及现象描述 昨天换了台电脑,有些软件需要重新安装或更新一下,遇到了下面的问题 cv@xys-MacBook-Pro ~ % brew upda ...
- 使用Varnish代替Squid做网站缓存加速器的详细解决方案----转载
[文章作者:张宴 本文版本:v1.2 最后修改:2008.01.02 转载请注明出处:http://blog.s135.com] 我曾经写过一篇文章──<初步试用Squid的替代产品──Varn ...
- SSO单点登录解决方案[转载]
1 什么是单点登陆 单点登录(Single Sign On),简称为 SSO,是目前比较流行的企业业务整合的解决方案之一.SSO的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互 ...
- InstallShield安装包在Win7下权限问题的解决方案 (转载)
转载:http://blog.csdn.net/wuzhengqing1/article/details/6570149 转载:http://blog.csdn.net/brikoff/article ...
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案(转载)
转载:http://www.th7.cn/Program/c/201303/127343.shtml 原因是Visual C++ 2012 使用了更加安全的 run-time library rout ...
- ajax乱码问题 服务端 客户端 两种的解决方案--转载
今天弄了一天的Ajax中文乱码问题,Ajax的乱码问题分为两种: 1. JavaScript输出的中文乱码, 比如:alert("中文乱码测试"); 2. 这第二种就是Ajax从服 ...
- gem update --system 302 错误 解决方案(转)
具体过程如下: 1.InstantRails-2.0安装后,在配置环境变量path中配置ruby/bin目录(如果系统中有多个RUBY,执行命令行的时候系统认的就是path中的) 2.进入DOS命令行 ...
- java系统高并发解决方案(转载收藏)
一个小型的网站,比如个人网站,可以使用最简单的html静态页面就实现了,配合一些图片达到美化效果,所有的页面均存放在一个目录下,这样的网站对系统架构.性能的要求都很简单,随着互联网业务的不断丰富,网站 ...
- Win 7 Windows Update无法自动更新解决方案
最近发现系统很长时间没有自动更新过了,手动更新后,提示返回错误码WindowsUpdate_8024402F.网络上搜索到的解决方法大多是删除更新临时目录,重启WINDOWS UPDATE服务,然而试 ...
随机推荐
- Python resources
我想很多程序员应该记得 GitHub 上有一个 Awesome - XXX 系列的资源整理.awesome-python 是 vinta 发起维护的 Python 资源列表,内容包括:Web框架.网络 ...
- 网络编程 - 1.简单的套接字通信/2.加上通信循环/3.bug修复/4.加上链接循环/5.模拟ssh远程执行命令
1.简单的套接字通信 服务端 ''' 服务端 接电话 客户端 打电话 1.先启动服务端 2.服务端有两种套接字 1.phone 用来干接收链接的 2.conn 用来干收发消息的 ''' import ...
- 转!!Linux 里的 2>&1 究竟是什么
原博文地址:https://blog.csdn.net/shunzi1046/article/details/76110963 我们在Linux下经常会碰到nohup command>/dev/ ...
- POJ1470Closest Common Ancestors 最近公共祖先LCA 的 离线算法 Tarjan
该算法的详细解释请戳: http://www.cnblogs.com/Findxiaoxun/p/3428516.html #include<cstdio> #include<alg ...
- 转:docker的核心技术深度剖析
一.docker是什么 Docker的英文本意是码头工人,也就是搬运工,这种搬运工搬运的是集装箱(Container),集装箱里面装的可不是商品货物,而是任意类型的App,Docker把App(叫Pa ...
- python常见模块之random模块
import random print(random.random()) #随机产生一个0-1之间的小数 print(random.randint(1,3)) #随机产生一个1-3之间的整数,包括1和 ...
- 爬虫之FileCookieJar
简介 虽然CookieJar模块能够做到给请求设置cookie,但是它的cookie是保存在内存里的,每次用都需要重新设置, 这就衍生了一个它的子类---FileCookieJar,它可以将cooki ...
- django 密文 cookie 加密
默认cookie是明文 # 加密cookie salt 通过这个字符串把cookie内容加密 obj.set_signed_cookie('username111','aaaa',salt=" ...
- python16_day20【Django_继续抽屉项目】
一.djangoAdmin和表结构 1.项目名称 python manage startapp web # 前端页面 python manage startapp repository # 只是数 ...
- Linux系统——账号管理
用户账号管理 分类: 超级用户 root uid=0 gid=0 权限最大 普通用户 uid=>500 ,一般权限的系统管理 程序用户 1=<uid,为了提升系统安全性,支持所对应服务对系 ...