ubuntu sudo update下sudo apt update 失败

ubuntu 源更新不了 sudo apt-get update里面显示的通通忽略_百度知道sudo apt-get update
报了一堆错误:
Err http://cn. trusty InRelease
Err http://cn. trusty-updates InRelease
Err http://cn. trusty-backports InRelease
Err http://cn. trusty Release.gpg
W: Failed to fetch http://cn./ubuntu/dists/trusty/InRelease
错误显示了源有问题,好像是被墙了。
查找解决办法,修改/etc/apt/source.list文件。将源改成163的或者阿里的:
deb /ubuntu/ vivid main restricted universe multiverse
deb /ubuntu/ vivid-security main restricted universe multiverse
deb /ubuntu/ vivid-updates main restricted universe multiverse
deb /ubuntu/ vivid-proposed main restricted universe multiverse
deb /ubuntu/ vivid-backports main restricted universe multiverse
deb-src /ubuntu/ vivid main restricted universe multiverse
deb-src /ubuntu/ vivid-security main restricted universe multiverse
deb-src /ubuntu/ vivid-updates main restricted universe multiverse
deb-src /ubuntu/ vivid-proposed main restricted universe multiverse
deb-src /ubuntu/ vivid-backports main restricted universe multiverse
但是source.list文件是只读的,修改不了。
要使用sudo gedit&/etc/apt/source.list修改,但是gedit 指令没有装,使用sudo apt-get install gedit又安装不了。
解决办法:(修改DNS)
sudo vi /etc/resolvconf/resolv.conf.d/base
在里面插入:nameserver&8.8.8.8nameserver&8.8.4.4
修改好保存!wq,
sudo resolvconf -u
再看/etc/resolv.conf,最下面就多了2行:
cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
sudo apt-get update
可以运行,然后就可以使用sudo apt-get install **指令了。
阅读(...) 评论()ubuntu 12.04 sudo apt-get update 错误_百度知道3982人阅读
Linux(31)
当运行apt-get update后出现如下错误时:
E: Some index files failed to download, they have been ignored, or old ones used instead.
可以将目录下/var/lib/apt/lists/partial/所有的文件清掉,再次运行apt-get update即可!自带源在大陆不好。
出现以下错误:
/etc/apt$ sudo apt-get update
precise-security InRelease
precise-security Release.gpg
Temporary failure resolving ''
Err http://cn. precise InRelease
Err http://cn. precise-updates InRelease
Err http://cn. precise-backports InRelease
Err http://cn. precise Release.gpg
Temporary failure resolving 'cn.'
Err http://cn. precise-updates Release.gpg
Temporary failure resolving 'cn.'
Err http://cn. precise-backports Release.gpg
Temporary failure resolving 'cn.'
Reading package lists... Done
W: Failed to fetch http://cn./ubuntu/dists/precise/InRelease
W: Failed to fetch http://cn./ubuntu/dists/precise-updates/InRelease
W: Failed to fetch http://cn./ubuntu/dists/precise-backports/InRelease
W: Failed to fetch /ubuntu/dists/precise-security/InRelease
W: Failed to fetch /ubuntu/dists/precise-security/Release.gpg
Temporary failure resolving ''
W: Failed to fetch http://cn./ubuntu/dists/precise/Release.gpg
Temporary failure resolving 'cn.'
W: Failed to fetch http://cn./ubuntu/dists/precise-updates/Release.gpg
Temporary failure resolving 'cn.'
W: Failed to fetch http://cn./ubuntu/dists/precise-backports/Release.gpg
Temporary failure resolving 'cn.'
W: Some index files failed to download. They have been ignored, or old ones used instead.
配置文件地址 /etc/resolv.conf
使用编辑器打开
改为如下内容:
search localdomain
nameserver 202.96.128.86 希望修改成的DNS
nameserver 202.96.128.166 备用DNS
重启网络:sudo /etc/init.d/networking restart。即可
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:987689次
积分:9528
积分:9528
排名:第1280名
原创:28篇
转载:463篇
评论:133条
(1)(18)(13)(3)(2)(8)(21)(1)(2)(10)(4)(2)(11)(15)(4)(4)(15)(1)(12)(14)(1)(1)(1)(14)(22)(23)(19)(15)(23)(9)(46)(1)(2)(18)(35)(6)(10)(4)(8)(4)(12)(19)(19)(11)(3)(6)ubuntu sudo apt-get update无法更新 - 开源中国社区
当前访客身份:游客 [
当前位置:
共有5个答案
<span class="a_vote_num" id="a_vote_num_
<span class="a_vote_num" id="a_vote_num_
<span class="a_vote_num" id="a_vote_num_
<span class="a_vote_num" id="a_vote_num_
可能是你的版本太老了,或者更新源错误
<span class="a_vote_num" id="a_vote_num_
请先确保你的Ubuntu服务器能稳定地连上和cn..
更多开发者职位上
有什么技术问题吗?
熊英的其它问题
类似的话题

我要回帖

更多关于 sudo apt update 失败 的文章

 

随机推荐