问题:

执行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. Linux 环境下wordpress后台安装主题及插件需要FTP帐号怎么办?

    vi httpd.conf 查看user是哪个用户  我的是daemon 然后执行 chown daemon:daemon -R /data/wordpress /data/wordpress 是我的 ...

  2. 管理Entity Framework中的树结构

    很多时候您需要在数据库中存储逻辑树的层次结构.这个问题有很多种实现方式,但最常见的是使用一个简单自关联的表,如下图所示 如果您映射此表与实体框架您将自动获得一个树状结构,您需将关系字段重命名,因为他们 ...

  3. VS编译静态库 .lib 其中Release 版本比Debug版本要大好多原因

    如果工程代码使用了: 把此选项关闭即可减少库大小不少:

  4. 多线程 同步对象 event 简单实例 &进程间通信

    多线程 同步对象event import threading,time class Boss(threading.Thread): def run(self): print("BOSS:今晚 ...

  5. Java实现主线程等待子线程

    本文介绍两种主线程等待子线程的实现方式,以5个子线程来说明: 1.使用Thread的join()方法,join()方法会阻塞主线程继续向下执行. 2.使用Java.util.concurrent中的C ...

  6. 大神的---解决tomcat内存溢出问题----tomcat报错:This is very likely to create a memory leak问题解决

    tomcat memory leak解决方案 这种问题在开发中经常会碰到的,看看前辈的总结经验 Tomcat内存溢出的原因  在生产环境中tomcat内存设置不好很容易出现内存溢出.造成内存溢出是不一 ...

  7. 使用OpenSsl自己CA根证书,二级根证书和颁发证书(亲测步骤)

    ---恢复内容开始--- 一.介绍 企业自用, 到证书机构签发证书的费用和时间等都可以省下..... SSl证书的背景功用.......(省略万字,不废话) 可以参考: SSL证书_百度百科 X509 ...

  8. Binormal - 副法线

    [Binormal - 副法线] Binormal是垂直于Normal.Tangent平面的直线.Normal.Binormal.Tangent三条线构成一个坐标系. 参考:http://202.11 ...

  9. Python shutil 模块学习笔记

    学于https://automatetheboringstuff.com shutil 名字来源于 shell utilities,有学习或了解过Linux的人应该都对 shell 不陌生,可以借此来 ...

  10. PHPexcle案例

    下面是总结的几个使用方法 include 'PHPExcel.php'; include 'PHPExcel/Writer/Excel2007.php'; //或者include 'PHPExcel/ ...