问题:

执行sudo apt-get update提示:Failed to fetch

chen@ubuntu:~/soft/Python-2.7.$ sudo apt-get update
Get: http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu xenial InRelease [2,281 B]
Err: http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu xenial InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched , B in 0s (, B/s)
Reading package lists... Done
E: Failed to fetch http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu/dists/xenial/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Some index files failed to download. They have been ignored, or old ones used instead.

但是在虚拟机里面直接访问:http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu 是可以的啊

一、删除文件

  sudo rm -rf /var/lib/apt/lists

二、删除所有源

  

  

三、修改源

sudo vi /etc/apt/sources.list

里面写入163的源

deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

  查看源

  

四、测试

再次sudo apt-get update

  提示如下:

guchen@ubuntu:~/soft/Python-2.7.$ sudo apt-get update
Get: http://mirrors.163.com/ubuntu xenial InRelease [2,281 B]
Get: http://mirrors.163.com/ubuntu xenial-security InRelease [2,281 B]
Err: http://mirrors.163.com/ubuntu xenial InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Err: http://mirrors.163.com/ubuntu xenial-security InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get: http://mirrors.163.com/ubuntu xenial-updates InRelease [2,281 B]
Err: http://mirrors.163.com/ubuntu xenial-updates InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get: http://mirrors.163.com/ubuntu xenial-proposed InRelease [2,281 B]
Err: http://mirrors.163.com/ubuntu xenial-proposed InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get: http://mirrors.163.com/ubuntu xenial-backports InRelease [2,281 B]
Err: http://mirrors.163.com/ubuntu xenial-backports InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched , B in 0s (19.8 kB/s)
Reading package lists... Done
E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial-security/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial-updates/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial-proposed/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial-backports/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Some index files failed to download. They have been ignored, or old ones used instead.

五、切换认证

怎么还提示:does the network require authentication?

需要权限??

解决方法:将software$updates中的Authentication换一个试试

六、成功

  最后再执行一下:

sudo apt-get clean

sudo apt-get update

guchen@ubuntu:~/soft/Python-2.7.$ sudo apt-get update
Get: http://mirrors.163.com/ubuntu xenial InRelease [247 kB]
Get: http://mirrors.163.com/ubuntu xenial-security InRelease [107 kB]
Get: http://mirrors.163.com/ubuntu xenial-updates InRelease [109 kB]
Get: http://mirrors.163.com/ubuntu xenial-proposed InRelease [260 kB]
Get: http://mirrors.163.com/ubuntu xenial-backports InRelease [107 kB]
Get: http://mirrors.163.com/ubuntu xenial/main Sources [868 kB]
Get: http://mirrors.163.com/ubuntu xenial/restricted Sources [4,808 B]
Get: http://mirrors.163.com/ubuntu xenial/universe Sources [7,728 kB]
Get: http://mirrors.163.com/ubuntu xenial/multiverse Sources [179 kB]
Get: http://mirrors.163.com/ubuntu xenial/main amd64 Packages [1,201 kB]
Get: http://mirrors.163.com/ubuntu xenial/main i386 Packages [1,196 kB]
Get: http://mirrors.163.com/ubuntu xenial/main Translation-en [568 kB]
Get: http://mirrors.163.com/ubuntu xenial/main amd64 DEP-11 Metadata [733 kB]
Get: http://mirrors.163.com/ubuntu xenial/main DEP-11 64x64 Icons [409 kB]
Get: http://mirrors.163.com/ubuntu xenial/restricted amd64 Packages [8,344 B]
Get: http://mirrors.163.com/ubuntu xenial/restricted i386 Packages [8,684 B]
Get: http://mirrors.163.com/ubuntu xenial/restricted Translation-en [2,908 B]
Get: http://mirrors.163.com/ubuntu xenial/restricted amd64 DEP-11 Metadata [186 B]
Get: http://mirrors.163.com/ubuntu xenial/universe amd64 Packages [7,532 kB]
Get: http://mirrors.163.com/ubuntu xenial-backports/universe DEP-11 64x64 Icons [1,789 B]
Get: http://mirrors.163.com/ubuntu xenial-backports/multiverse amd64 DEP-11 Metadata [216 B]
Get: http://mirrors.163.com/ubuntu xenial-backports/multiverse DEP-11 64x64 Icons [29 B]
Fetched 53.4 MB in 18s (, kB/s)
AppStream cache update completed, but some metadata was ignored due to errors.
Reading package lists... Done

终于搞定啦

备注:

最好把DNS设置一下

sudo vi /etc/resolv.conf

在里面添加

nameserver 8.8.8.8

重启网络服务

sudo service networking restart

Ubuntu sudo apt-get update提示 Failed to fetch,解决办法的更多相关文章

  1. ubuntu Linux 测试PHP却提示下载文件的解决办法

    ubuntu Linux 测试PHP却提示下载文件的解决办法   一般这种情况都是在刚刚开始配置环境时出现的, 输入 sudo a2enmod php5  看提示如果出现“$ This module ...

  2. Ubuntu字符界面输入密码始终提示错误 login incorrect 解决办法

    方法1. 先输入用户名按enter,然后ctrl+alt+f7 切换回图形界面,然后再切换到字符界面输密码 方法2.先输入用户名按enter,然后关闭小键盘上的numlock按键再打开,再输入密码 f ...

  3. ubuntu下修改mysql默认字符编码出现的Job failed to start解决办法

    ubuntu下修改mysql默认字符编码出现的Job failed to start解决办法 前几天卸掉了用了好多年的Windows,安装了Ubuntu12.04,就开始各种搭环境.今天装好了MySQ ...

  4. Typora配置PicGo时,提示Failed to fetch【Bug集中营】

    Typora配置PicGo时,提示Failed to fetch 两者配置的端口不一致造成的 打开Typora,选择文件-偏好设置-图像-验证图片上传选项,点击验证图片上传选项 会提示错误:Faile ...

  5. Ubuntu下Linux配置内核各种常见错误和解决办法

    镜像下载.域名解析.时间同步请点击阿里云开源镜像站 这篇把Ubuntu下Linux配置内核各种常见错误和解决办法给大家讲解一下,希望可以帮助到大家. 一.Ubuntu系统中缺少各种依赖包导致的问题 1 ...

  6. Mac打开应用提示已损坏的解决办法

    相信很多升级了最新Mac系统的用户在打开一些应用的时候都会出现“应用XX已损坏”的系统提示,安装这些应用的时候总是提示“已损坏,移至废纸篓”这类信息,根本无法打开应用. Mac打开应用提示已损坏的解决 ...

  7. vs智能提示突然消失的解决办法 (vs2008 vs2010 vs2012 智能提示)

    vs智能提示突然消失的解决办法 (vs2008 vs2010 vs2012 智能提示) 下面一段话是网上找到的解决方案: 重置Visual Studio可以解决此问题,方法是从开始->Micro ...

  8. Win8.1安装VirtualSVN Server发生service visualSVN Server failed to start解决办法

    Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in Event Viewer for mo ...

  9. Win7 64bit 安装VisualSVN出现报错:Servic 'VisualSVN Server' failed to start.解决办法

    问题描述: Win7 64bit 安装VisualSVN时出现报错: Servic 'VisualSVN Server' failed to start.Please check VisualSVN ...

随机推荐

  1. chrom中安装elastic search head插件

    1. 访问https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm/ ...

  2. 设置Eclipse中的tab键为4个空格

    在工具栏上找到window,点击 window->preference 然后在打开的界面中选择 General->Editors->Text Editors, 再选中右侧的 inse ...

  3. Python的索引迭代

    Python中,迭代永远是取出元素本身,而非元素的索引. 对于有序集合,元素确实是有索引的.有的时候,我们确实想在 for 循环中拿到索引,怎么办? 方法是使用 enumerate() 函数: > ...

  4. Linux 入门知识一(附上如何解决Ubuntu的root密码问题)

    .centos有拥有七个控制台,其中第一到第六个是字符界面,第七个是图形界面 切换的快捷键是ctrl+shift+fn(n为自然数)   输入tty的话,可以检查当前处于哪个控制台   如何在cent ...

  5. AngularJS与服务器交互(4)

    转自:http://itindex.net/detail/50919-angularjs-%E6%9C%8D%E5%8A%A1%E5%99%A8-%E4%BA%A4%E4%BA%92 对于AJAX应用 ...

  6. Gouraud Shading

    [Gouraud Shading] Gouraud Shading (高洛德着色/高氏着色) 这种着色的效果要好得多,也是在游戏中使用最广泛的一种着色方式.它可对3D模型各顶点的颜色进行平滑.融合处理 ...

  7. Python操作SQLServer示例

    本文主要是Python操作SQLServer示例,包括执行查询及更新操作(写入中文). 需要注意的是:读取数据的时候需要decode('utf-8'),写数据的时候需要encode('utf-8'), ...

  8. Gson 是google解析Json的一个开源框架,同类的框架fastJson,JackJson

    Gson 是google解析Json的一个开源框架,同类的框架fastJson,JackJson等等 本人fastJson用了两年,也是从去年才开始接触Gson,希望下面的总结会对博友有用,至于Gso ...

  9. 函数用途:同一域名对应多个IP时,获取指定服务器的远程网页内容

    <?php /************************ * 函数用途:同一域名对应多个IP时,获取指定服务器的远程网页内容 * 创建时间:2008-12-09 * 创建人:张宴(img. ...

  10. Java中的静态代理实现方式

    1.编写一个接口类 如:Subject package com.neusoft.pattern.staticProxy; /** * <p>Title:</p> * <p ...