Ubuntu系统无法update的解决方法

今天安装Ubuntu系统的时候,出现了一些状况,首先说个自己犯的幼稚错误。

  1. 首先我制作好了启动盘,并且按着步骤安装完系统。

  2. 进入系统,我自认为输入了密码,进入了我的账号(其实此时是客户模式)

  3. 当我进入终端–进行指令的输入 su 回车—-提示我无法访问,查阅相关的资料都无法解决,后来重启电脑,这次进入的是我自己的账号,再次输入su 回车 ,输入root 密码两次,壁俺可以了。(听着是不是很容易,但是我起初弄了半个小时,就是没发现这个问题!很愚蠢啊!)

好啦!言归正传,回到我这次博客遇到的问题中来,我输入 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

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

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

1.我使用的ubuntu版本是14.10,属于非LTS(长期支持版本),使用apt-get update来更新源,现在已提示更新失败,无法下载,无法访问了。

2.在网上找了很多Ubuntu14.10对应的源的列表,然后把它们加入到了系统的源列表中,可还是不行。但是,所有停止维护的版本都可以使用old源。所以在元列表中把原来的地址改为带有old源的就可以了。

3.首先,备份系统中的源列表,打开终端,输入
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
来进行更新,会看到没有失败的提示了,转而出现“命中,获取中”等字眼。
这里写图片描述

这里写图片描述

(本博客图片是在公司电脑上安装操作的,相片是通过手机拍摄下来的,为了博客写作的参考!)

  • 5
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值