烂记性更要记笔记

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

        在ubuntu14.04 执行命令 apt-get update 时,出现大量failed to fetch 错误 ,Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/main/binary-i386/Packages,诸如这种failed to fetch ......  Hash permission ......等错误。在ubuntu software替换其他源,reload 时,总是failed,还提醒 check your internet . 一直尝试网上各种方法,都没有解决,经历一个上午,居然摸索出了一种百试不厌的方法。

       遇到这种问题,解决方法如下:

        第一步: 先用cp命令 将系统官方的源文件备份。

       第二步:在root权限 下,执行 gedit  /etc/apt/sources.list   将该文件中的内容替换成以下搜狐源的内容。然后执行apt-get update ,发现就没有报failed to fetch...这种错误。但这个源可能不包含你要的软件。那就需要换一个源。再打开 software&update  -》  ubuntu software ,下面的五个框框都勾上(最后一个是source code)  ,Download from  里面-other->china->..*163.com  这个源。我是换的163的源。其他的源没试过。reload成功后,重启。之后再运行apt-get update,就更新成163的源了。且不报错误。

  • 搜狐源
复制代码
deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
deb http://mirrors.sohu.com/ubuntu/ precise universe
deb-src http://mirrors.sohu.com/ubuntu/ precise universe
deb http://mirrors.sohu.com/ubuntu/ precise-updates universe
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates universe
deb http://mirrors.sohu.com/ubuntu/ precise multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse

       第二种方法:今天用第一种方法突然失策了,看了另外一个人的博客,按照他的方法去做,竟然可以了,看来可能真的是缓存的原因。

下面附那位博主的博客链接。感谢。。

http://blog.csdn.net/yanli33/article/details/70158100

1)我是先清理了缓存 :rm -fR /var/lib/apt/lists/*

2)然后改动了阿里云的源,把sources.list中的http://mirrors.aliyun.com/ubuntu/  都改成http://mirrors.aliyun.com/ubuntu/ubuntu/,保存,退出

3)运行apt-get update ,成功!

 

方法三:试了上述两种都不行,报错404 not found,而且总是加载之前的源 old-release ubuntu ,虽然我更改了源文件 /etc/apt/sources.list 里的源。但还是这样,后来发现是因为software&updates里面的other software里面有很多源路径,都是之前加载失败的,把这个源的勾去掉后,再重新reload,就可以了。

posted on 2017-07-25 16:08  烂记性更要记笔记  阅读(26712)  评论(0编辑  收藏  举报