出现问题:
apt update的时候一直卡在同一个文件处,换各种源也都不好使。如下,一直卡在Get:23始终显示0% [Working],但是working一宿还是0%。
root@b5848479d6c5:/etc/apt# apt update
Get:2 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/main Sources [1103 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/restricted Sources [5179 B]
Get:8 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [440 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Sources [2696 B]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [339 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1507 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [13.1 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [1033 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-security/main Sources [208 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-security/restricted Sources [2243 B]
Get:20 http://archive.ubuntu.com/ubuntu xenial-security/universe Sources [147 kB]
Get:21 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1143 kB]
Get:22 http://archive.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
Get:23 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [631 kB]
0% [Working]^C
解决方法:
rm -r /etc/apt/sources.list.d
apt clean
root@b5848479d6c5:/etc/apt# apt update
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial/main Sources [1103 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/restricted Sources [5179 B]
Get:6 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [440 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Sources [2696 B]
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [339 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1507 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [13.1 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [1033 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-security/main Sources [208 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-security/restricted Sources [2243 B]
Get:18 http://archive.ubuntu.com/ubuntu xenial-security/universe Sources [147 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1143 kB]
Get:20 http://archive.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
Get:21 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [631 kB]
Fetched 28.3 MB in 1min 37s (288 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
214 packages can be upgraded. Run 'apt list --upgradable' to see them.
这点事折腾2天终于好了。