使用sudo apt-get update更新ubuntu软件出现的问题
在更新ubuntu软件时显示网络不可达
hadoop@hadoop-virtual-machine:~$ sudo apt-get update
命中:1 https://mirrors.ustc.edu.cn/ubuntu xenial InRelease
命中:2 https://mirrors.ustc.edu.cn/ubuntu xenial-backports InRelease
命中:3 https://mirrors.ustc.edu.cn/ubuntu xenial-security InRelease
命中:4 https://mirrors.ustc.edu.cn/ubuntu xenial-updates InRelease
错误:5 http://cn.archive.ubuntu.com/ubuntu xenial InRelease
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达) [IP: 2001:67c:1562::15 80]
错误:6 http://cn.archive.ubuntu.com/ubuntu xenial-updates InRelease
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达) [IP: 2001:67c:1562::15 80]
错误:7 http://cn.archive.ubuntu.com/ubuntu xenial-security InRelease
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达) [IP: 2001:67c:1562::15 80]
正在读取软件包列表... 完成
W: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial/InRelease 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达) [IP: 2001:67c:1562::15 80]
W: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达) [IP: 2001:67c:1562::15 80]
W: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达) [IP: 2001:67c:1562::15 80]
W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。
在软件和更新中将ubuntu软件中“下载自”改为其他站点
我选择的是
http://mirrors.aliyun.com/ubuntu
之后重新使用命令sudo apt-get update更新,出现以下情况:只显示命中,没有显示已下载
hadoop@hadoop-virtual-machine:~$ sudo apt-get update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
命中:4 https://mirrors.ustc.edu.cn/ubuntu xenial InRelease
命中:5 https://mirrors.ustc.edu.cn/ubuntu xenial-backports InRelease
命中:6 https://mirrors.ustc.edu.cn/ubuntu xenial-security InRelease
命中:7 https://mirrors.ustc.edu.cn/ubuntu xenial-updates InRelease
正在读取软件包列表... 完成
使用命令
sudo apt-get dist-upgrade
结果
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
正在计算更新... 完成
下列软件包将被升级:
ubuntu-advantage-tools
升级了 1 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 160 kB 的归档。
解压缩后会消耗 777 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 ubuntu-advantage-tools amd64 27.11.2~16.04.1 [160 kB]
已下载 160 kB,耗时 1秒 (135 kB/s)
正在预设定软件包 ...
(正在读取数据库 ... 系统当前共安装有 215154 个文件和目录。)
正准备解包 .../ubuntu-advantage-tools_27.11.2~16.04.1_amd64.deb ...
grep: /etc/ubuntu-advantage/uaclient.conf: 没有那个文件或目录
正在将 ubuntu-advantage-tools (27.11.2~16.04.1) 解包到 (10ubuntu0.16.04.1) 上 ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在设置 ubuntu-advantage-tools (27.11.2~16.04.1) ...
Removing obsolete conffile /etc/update-motd.d/99-esm ...
之后再使用命令
sudo apt-get update
完成。