学习笔记之ubuntu sudo apt-get update失败已经解决

ubuntu sudo apt-get update失败已经解决

运行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

解决办法:
首先看看网络是否通,如果不通请参考以下链接:
https://blog.csdn.net/weixin_41486034/article/details/106802522

如果网络是通的,那么就按下面的步骤来:
在ubuntu16中,当我们输入sudo apt-get update会失败,这里有很多原因
(1)网络原因----先检查网络好不好用
(2)ubuntu16 自带的源不好用,或者有问题
我遇到的问题是:
E: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial/InRelease 明文签署文件不可用,结果为‘NOSPLIT’(您的网络需要认证吗?)
E: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease 明文签署文件不可用,结果为‘NOSPLIT’(您的网络需要认证吗?)
E: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease 明文签署文件不可用,结果为‘NOSPLIT’(您的网络需要认证吗?)
E: 无法下载 http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease 明文签署文件不可用,结果为‘NOSPLIT’(您的网络需要认证吗?)
E: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。
这个就是源的问题,
解决方案:
(1)编辑/etc/apt/sources.list文件
在命令行中输入: sudo vim /etc/apt/sources.list 或者 sudo gedit /etc/apt/sources.list 推荐使用后者
(2)在上面打开的文件开头添加
中科大的源(亲测可用):

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

或者阿里源(未测试):

deb http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse

之后输入:
sudo apt-get update
就成功啦,绝对好用!! 欢迎留言—关注也可以哦
参考链接:https://blog.csdn.net/weixin_41486034/article/details/106240240

猜你喜欢

转载自blog.csdn.net/weixin_41486034/article/details/106858461