情况
当我使用 APT 或 APTITUDE 更新 Debian 9.5 amd64(稳定、向后移植、测试、不稳定)软件包列表时,截至撰写本文时,更新的下载大小为 cca 60 MB,其中一半大小是图标文件,例如图标-128x128。
我相信我不需要下载图标,因为我没有使用 GUI 包管理器。
目标
我想将更新的下载大小限制为最小以节省时间。
问题
是否可以在不下载图标文件的情况下更新软件包列表?更新下载中还可以省略哪些内容?如果是,怎么办?如果没有,为什么?
答案1
您所看到的可能是由 的活动引起的appstream
。
看https://www.freedesktop.org/software/appstream/docs/sect-AppStream-IconCache.html或者https://askubuntu.com/questions/775069/what-is-appstream-why-is-it-installed-what-is-it-doing。
安装后appstream
,sudo apt update
会生成如下内容(在 Xubuntu 18.10 上):
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Get:2 http://security.ubuntu.com/ubuntu cosmic-security InRelease [83.2 kB]
Hit:3 http://in.archive.ubuntu.com/ubuntu cosmic InRelease
Get:4 http://in.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]
Get:5 http://dl.google.com/linux/chrome/deb stable Release [943 B]
Get:6 http://dl.google.com/linux/chrome/deb stable Release.gpg [819 B]
Hit:7 http://in.archive.ubuntu.com/ubuntu cosmic-backports InRelease
Get:8 http://security.ubuntu.com/ubuntu cosmic-security/main i386 Packages [33.4 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main i386 Packages [47.7 kB]
Get:10 http://security.ubuntu.com/ubuntu cosmic-security/main amd64 Packages [33.4 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 Packages [49.4 kB]
Get:12 http://security.ubuntu.com/ubuntu cosmic-security/main Translation-en [13.7 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main Translation-en [20.2 kB]
Get:14 http://security.ubuntu.com/ubuntu cosmic-security/main amd64 DEP-11 Metadata [204 B]
Get:15 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 DEP-11 Metadata [52.0 kB]
Get:16 http://security.ubuntu.com/ubuntu cosmic-security/main DEP-11 48x48 Icons [29 B]
Get:17 http://security.ubuntu.com/ubuntu cosmic-security/main DEP-11 64x64 Icons [29 B]
Get:18 http://security.ubuntu.com/ubuntu cosmic-security/universe amd64 Packages [22.2 kB]
Get:19 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main DEP-11 48x48 Icons [5,926 B]
Get:20 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main DEP-11 64x64 Icons [8,457 B]
Get:21 http://security.ubuntu.com/ubuntu cosmic-security/universe i386 Packages [22.2 kB]
Get:22 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe i386 Packages [29.9 kB]
Get:23 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe amd64 Packages [29.9 kB]
Get:24 http://security.ubuntu.com/ubuntu cosmic-security/universe Translation-en [11.8 kB]
Get:25 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe Translation-en [15.4 kB]
Get:26 http://security.ubuntu.com/ubuntu cosmic-security/universe amd64 DEP-11 Metadata [2,448 B]
Get:27 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe amd64 DEP-11 Metadata [5,724 B]
Get:28 http://security.ubuntu.com/ubuntu cosmic-security/universe DEP-11 48x48 Icons [4,031 B]
Get:29 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe DEP-11 48x48 Icons [4,031 B]
Get:30 http://security.ubuntu.com/ubuntu cosmic-security/universe DEP-11 64x64 Icons [4,058 B]
Get:31 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe DEP-11 64x64 Icons [4,058 B]
Reading package lists... Done
上例中图标的下载相对较小,但在处于 alpha 或 beta 开发阶段的发行版中可能有几个 MB。
如果如你所说,
我不需要下载图标,因为我没有使用 GUI 包管理器。
只需在继续之前运行sudo apt purge appstream
并检查输出:
$ sudo apt purge appstream*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'appstream-generator' for glob 'appstream*'
Note, selecting 'appstream-glib-doc' for glob 'appstream*'
Note, selecting 'appstream' for glob 'appstream*'
Note, selecting 'appstream-util' for glob 'appstream*'
Note, selecting 'appstream-index' for glob 'appstream*'
Note, selecting 'appstream-doc' for glob 'appstream*'
Note, selecting 'appstream-qt5' for glob 'appstream*'
Note, selecting 'appstream' instead of 'appstream-index'
Package 'appstream-qt5' is not installed, so not removed
Package 'appstream-doc' is not installed, so not removed
Package 'appstream-glib-doc' is not installed, so not removed
Package 'appstream-generator' is not installed, so not removed
Package 'appstream-util' is not installed, so not removed
The following packages will be REMOVED:
appstream* apt-config-icons* gnome-software* gnome-software-plugin-snap*
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 3,029 kB disk space will be freed.
Do you want to continue? [Y/n]
当然,您在系统上看到的内容可能会有所不同。