我输入 sudo apt-get update 出现错误:

/etc/apt$ sudo apt-get update
Err http://security.ubuntu.com precise-security InRelease Err http://security.ubuntu.com precise-security Release.gpg
Temporary failure resolving 'security.ubuntu.com'
Err http://cn.archive.ubuntu.com precise InRelease Err http://cn.archive.ubuntu.com precise-updates InRelease Err http://cn.archive.ubuntu.com precise-backports InRelease Err http://cn.archive.ubuntu.com precise Release.gpg
Temporary failure resolving 'cn.archive.ubuntu.com'
Err http://cn.archive.ubuntu.com precise-updates Release.gpg
Temporary failure resolving 'cn.archive.ubuntu.com'
Err http://cn.archive.ubuntu.com precise-backports Release.gpg
Temporary failure resolving 'cn.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise/InRelease W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Temporary failure resolving 'security.ubuntu.com' W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg Temporary failure resolving 'cn.archive.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead.
xinju@xinjuOffice:/etc/apt$ cd ../network

(错误当时没有记录下来上网找到了同样错误的提示!)

——-下面我们就一起讨论下这个情况!

所有停止维护的版本都可以使用old源。所以在元列表中把原来的地址改为带有old源的就可以了。

首先,备份系统中的源列表,打开终端,输入
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

4.输入
sudo gedit /etc/apt/sources.list
打开源列表文件,ctrl+A,然后delete,删除全部内容
然后把下面的地址复制到该文件中:

deb http://old-releases.ubuntu.com/ubuntu utopic main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu utopic-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu utopic-proposed main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu utopic-backports main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu utopic main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu utopic-updates main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu utopic-proposed main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu utopic-backports main restricted universe multiverse

5.需要注意的是上面地址中的 utopic是ubuntu系统版本的名称,我的ubuntu系统是14.10,对应的版本名称是utopic。只要把这里的utopic换车你自己系统版本的名称即可,如果不知道版本名称的话,可以运行以下命令获得
lsb_release -a
其中,Codename就是了。

6.保存好源列表文件后,进入到终端,一定要再输入以下命令
sudo apt-get update
来进行更新,会看到没有失败的提示了,转而出现“命中,获取中”等字眼。

本文为转载,出处为图片 上的网址。

Ubuntu中无法update的解决办法的更多相关文章

  1. Ubuntu系统 apt-get update失败解决办法

    使用apt-get的时候发现ubuntu和阿里云均已经不提供该版本的源,所以需要找到其他的替代源. 使用的ubuntu版本是14.10,属于非LTS(长期支持版本),因此前一段时间还可以使用apt-g ...

  2. 在win7系统下安装把Ubuntu17.04安装在另一个硬盘开机无法进入Ubuntu问题的一种解决办法。【转】

    本文转载自:http://blog.csdn.net/u012879090/article/details/74937762 在win7系统下安装把Ubuntu17.04安装在另一个硬盘开机无法进入U ...

  3. Oracle中的 UPDATE FROM 解决方法

    转:http://www.cnblogs.com/JasonLiao/archive/2009/12/23/1630895.html Oracle中的 UPDATE FROM 解决方法 在表的更新操作 ...

  4. vsftp在REDHAT,CENTOS 5中登录慢的解决办法

    vsftp在REDHAT,CENTOS 5中登录慢的解决办法 vsftp在REDHAT,CENTOS 5中不仅登录慢,至少花30秒左右,而且上传文件的速度也受影响, 经过摸索,根本原因在DNS解析上花 ...

  5. linux中tomcat内存溢出解决办法

    用命令 tail -f /root/apache-tomcat-6.0.20/logs/catalina.out(需要找到tomcat路径) 查看日志,查看是否有错误 linux中tomcat内存溢出 ...

  6. ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务解决办法

    ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务解决办法: 1.首先打开cmd命令 查看本地TNSPING配置 是否ok?然后找到 Oracle 安装文件 中 listener. ...

  7. .net core, docker 在vs2019开发过程中的问题以及解决办法

    .net core, docker 在vs2019开发过程中的问题以及解决办法 记录下来,帮助Ta人~ 1.vs调试,快Build完后提示Docker 端口:xxxx,xxxx,xxxx占用 解决办法 ...

  8. ubuntu下安装ESP8266开发环境步骤中可能出现的问题及解决办法

    安装步骤参考如下链接 https://www.jianshu.com/p/e9ce2a60df83 1.在GitHub上拉取代码时发生错误:RPC failed; curl 18 transfer c ...

  9. ubuntu sudo apt-get update 失败 解决方法

    sudo apt-get update 报了一堆错误: Err http://cn.archive.ubuntu.com trusty InRelease Err http://cn.archive. ...

随机推荐

  1. D 分组背包

    <span style="color:#3333ff;">/* ---------------------------------------------------- ...

  2. Linux黑洞

    1 什么是Linux黑洞 在Linux系统中,/dev/null是一个虚设的设备.俗称"Linux黑洞". 不论什么对/dev/null的写入都会成功.但数据会消失得无影无踪.没有 ...

  3. 压缩&amp;&amp;解压命令汇总

    下面是搜集的Linux系统下,压缩&&解压命令,以备參考使用.     .tar   解包: tar xvf FileName.tar   打包:tar cvf FileName.ta ...

  4. Oracle 数据块损坏与恢复具体解释

    1.什么是块损坏: 所谓损坏的数据块,是指块没有採用可识别的 Oracle 格式,或者其内容在内部不一致. 通常情况下,损坏是由硬件故障或操作系统问题引起的.Oracle 数据库将损坏的块标识为&qu ...

  5. Swift3.0中关于日期类的使用指引

    日期的处理在大大小小的iOS项目中都十分常见,随着Swift3.0正式版的即将推出,语法的改变让NSDate以及相关类的使用都与之前略有不同,这里将会对基于Swift3.0版本的NSDate及相关类的 ...

  6. Constructing Roads --hdoj

    Constructing Roads Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) ...

  7. number随时间随机递增每天 不同 php(原创)

    <?php namespace Controller; class IndexController{ public function getAutoRegUserName(){ $sql=&qu ...

  8. [MVC.NET] Asp.Net MVC3 简单入门第一季

    转自:http://www.cnblogs.com/fly_dragon/archive/2011/10/12/2208042.html 初识Asp.Net MVC2.0 初识Asp.Net MVC2 ...

  9. HTML网页做成ASP.NET后台的方法以及.NET后台控制前台样式的方法

    之前一直不知道,写好的纯HTML网页怎么做成ASP.NET后台的呢,因为之前使用别人的HTML模板写过一个自己的个人博客 果冻栋吖个人博客 当时用的PHP写的.一直在考虑怎么做成.NET的. 今天自己 ...

  10. Codeforces Round #451 & Codeforces Round #452

    Rounding Solution Proper Nutrition 枚举 Solution Phone Numbers 模拟 Solution Alarm Clock 贪心,好像不用线段树也可以,事 ...