问题:

执行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. Dijkstra 调度场算法 Python实现 一

    调度场算法(Shunting Yard Algorithm)是一个用于将中缀表达式转换为后缀表达式的经典算法,由 Edsger Wybe Dijkstra 引入,因其操作类似于火车编组场而得名.  — ...

  2. vector(实现存图)

    #include<cstdio> #include<algorithm> #include<cstring> #include<iostream> #i ...

  3. MyBatis 学习记录3 MapperMethod类

    主题 之前学习了一下MapperProxy的生产过程,自定义Mapper类的对象是通过动态代理生产的,调用自定义方法的时候实际上是调用了MapperMethod的execute方法:mapperMet ...

  4. MaperReduce实验

    目录 MaperReduce实现WordCount程序二次排序 前期准备 1. 工程结构 2. 编写自定义NewKey类 3. 编写WCMapper类 4. 编写WCReduer类 5. 编写作业描述 ...

  5. linux命令详解2-文件管理,查看文件命令

    1. cat命令(tac) ----连接文件,并打印出来(顺序打印)与tac命令类似只不过,tac命令是逆序打印 [语法] cat [OPTION]... [FILE]... [选项] -A:显示所有 ...

  6. 选择性导出excel表中内容

    package com.huawei.utils; import java.io.FileNotFoundException;import java.io.FileOutputStream;impor ...

  7. 40行代码爬取猫眼电影TOP100榜所有信息

    主要内容: 一.基础爬虫框架的三大模块 二.完整代码解析及效果展示 1️⃣  基础爬虫框架的三大模块 1.HTML下载器:利用requests模块下载HTML网页. 2.HTML解析器:利用re正则表 ...

  8. 高德地图-android 权限设置

    转自http://blog.csdn.NET/eyu8874521/article/details/8481953 一个Android应用程序需要权限才能调用某些android系统的功能:一个andr ...

  9. linux: cat more less tail head查看文件内容

  10. 【SPOJ - LCS2】Longest Common Substring II【SAM】

    题意 求出多个串的最长公共子串. 分析 刚学SAM想做这个题的话最好先去做一下那道codevs3160.求两个串的LCS应该怎么求?把一个串s1建自动机,然后跑另一个串s2,然后找出s2每个前缀的最长 ...