我正在运行 Ubuntu 20.04。我通过手机连接到互联网,每月数据限制。当我跑
apt update
它从存储库中获取大约 60 MB 的数据。有没有办法只获取之前运行的差异apt update
?
编辑:
sudo apt update
Hit:1 http://archive.canonical.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main Sources [364 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Sources [9,912 B]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/restricted Sources [10.1 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/universe Sources [146 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [795 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [192 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates amd64 Contents (deb) [29.7 MB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [143 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [21.3 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [736 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [152 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [16.9 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [5,076 B]
Get:19 http://archive.ubuntu.com/ubuntu focal-security/universe Sources [42.9 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal-security/main Sources [122 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal-security/restricted Sources [8,960 B]
Get:22 http://archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [480 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal-security/main Translation-en [105 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal-security amd64 Contents (deb) [23.6 MB]
Get:25 http://archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [120 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal-security/restricted Translation-en [17.6 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [532 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [532 kB]
Get:28 http://archive.ubuntu.com/ubuntu focal-security/universe Translation-en [74.5 kB]
看看这些:
Get:12 http://archive.ubuntu.com/ubuntu focal-updates amd64 Contents (deb) [29.7 MB]
Get:24 http://archive.ubuntu.com/ubuntu focal-security amd64 Contents (deb) [23.6 MB]
正如@nobody 所暗示的那样,您正在下载的这些大文件来自
apt-file
. 根据文档,您可以通过修改/etc/apt/apt.conf.d/50apt-file.conf
文件并运行来配置它/usr/share/doc/apt-file/examples/apt-file-2-update.sh
。.deb
从那里,您可以为这些文件设置本地缓存,例如:从那里你可以通过调用
apt-file
独立更新缓存:apt
这是直接取自 manpage,因此可能需要进行一些调整。