问题:

执行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. [转] C#实现在Sql Server中存储和读取Word文件 (Not Correct Modified)

    出处 C#实现在Sql Server中存储和读取Word文件 要实现在Sql Server中实现将文件读写Word文件,需要在要存取的表中添加Image类型的列,示例表结构为: CREATE TABL ...

  2. GridhEH 选择勾CheckBox

    GridhEH 选择勾CheckBox Grideh>IndicatorOptions>gioShowRowSelCheckbox

  3. spring-boot-actuator健康监控

    #健康监控 management.security.enabled=false health.mail.enabled =false http://localhost:54001/autoconfig ...

  4. Python基础学习九 数据库备份

    class BakDb(object): def __init__(self,ip,username,passwd,port=3306,path=r'C:\Users\BJQT\Desktop\dat ...

  5. visjs使用小记-2.option参数注释说明

    对部分参数进行中文说明,后续补充 var options = { nodes:{//节点配置 borderWidth: 1,//节点边框的宽度,单位为px borderWidthSelected: 2 ...

  6. 使用myeclipse开发java,解决java中继承JFrame类出现The type JFrame is not accessible due to restriction的问题

    在java中创建窗体,导入了java中的JFrame类,之后会出现错误: Access restriction: The type QName is not accessible due to res ...

  7. Ubuntu设置开机启动服务

    一.查看当前的运行级别 runlevel 二.加载服务 $ cd /etc/init.d $ sudo update-rc.d test defaults 95 三.增加默认启动脚本 sudo vi ...

  8. Android开发实战之拥有Material Design风格的侧滑布局

    在实现开发要求中,有需要会使用抽屉式布局,类似于QQ5.0的侧滑菜单,实现的方式有很多种,可以自定义控件,也可以使用第三方开源库. 同样的谷歌也推出了自己的侧滑组件——DrawLayout,使用方式也 ...

  9. A* 算法求第k短路径

    A*算法是一类贪心算法,其可以用于寻找最优路径.我们可以利用A*算法来求第k短路径. 一条路径可以由两部分组成,第一部分是一个从出发到达任意点的任意路径,而第二部分是从第一部分的末端出发,到终点的最短 ...

  10. 636. Exclusive Time of Functions 进程的执行时间

    [抄题]: Given the running logs of n functions that are executed in a nonpreemptive single threaded CPU ...