Ubuntu中无法update的解决办法
2024-09-08 06:07:03
我输入 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
来进行更新,会看到没有失败的提示了,转而出现“命中,获取中”等字眼。
本文为转载,出处为图片 上的网址。
最新文章
- RESTful 接口调试分享利器 restc
- TCP的定时器
- gvim配置
- ABAP中使用浏览器打开网页
- mp3文件 ID3v2 帧标识的含义
- SQL Server 动态管理视图(DMVs)
- c++builder XE8 线程 Thread
- java实现抓取某公司官网新闻
- 今天就注册上海ORACLE2用户组014在峰会酒吧!
- javascript sort排序
- Carbondata源码系列(一)文件生成过程
- NoSQL数据库
- RabbitMQ 简单测试
- vue组件详解(四)——使用slot分发内容
- .Net开发者必知的技术类RSS订阅指南
- 1.02-get-params
- python六十四课——高阶函数练习题(三)
- WEB测试重点--(转载)
- oldboy s21day01
- python sqlite3查看数据库所有表(table)
热门文章
- Hardware/Firmware/Software的区别
- Ubuntu下启动Eclipse报错:A Java RunTime Environment (JRE) or Java Development Kit (JDK) must
- Android ListView拉到顶/底部,像橡皮筋一样弹性回弹复位
- JavaScript和Java的区别
- bzoj3224: Tyvj 1728 普通平衡树(splay)
- php简单测试slim框架的功能
- Laravel-查询作用域
- Windows环境下使用强大的wget工具
- 在线word论文生成的方法
- 错误:Camera录制视频(6.0错误),5.1正常,7.1正常 (java.lang.RuntimeException: start failed.at android.media.MediaRecorder.native_start(Native Method))