我正在寻找一种方法来查找 apt 包的内容,然后我发现了一篇建议使用 apt-file 的帖子。我使用以下方法安装:
sudo apt install apt-file
sudo apt-file update
这次更新花了很长时间,而且有些软件包非常大。现在,即使我使用时,sudo apt update
似乎也有我在安装 apt-file 时添加的额外存储库。
$ sudo apt update
[sudo] password for david:
Hit:1 http://dl.google.com/linux/earth/deb stable InRelease
Hit:2 https://updates.signal.org/desktop/apt xenial InRelease
Hit:4 http://apt.pop-os.org/proprietary jammy InRelease
Get:5 https://updates.signal.org/desktop/apt xenial/main amd64 Contents (deb) [1,736 B]
Get:3 https://packages.microsoft.com/repos/code stable InRelease [3,590 B]
Get:6 https://packages.microsoft.com/repos/code stable/main amd64 Packages [18.6 kB]
Get:7 https://packages.microsoft.com/repos/code stable/main armhf Packages [18.7 kB]
Hit:8 http://apt.pop-os.org/release jammy InRelease
Get:9 https://packages.microsoft.com/repos/code stable/main arm64 Packages [18.7 kB]
Hit:10 https://ppa.launchpadcontent.net/freecad-maintainers/freecad-daily/ubuntu jammy InRelease
Hit:11 http://apt.pop-os.org/ubuntu jammy InRelease
Hit:12 https://ppa.launchpadcontent.net/freecad-maintainers/freecad-stable/ubuntu jammy InRelease
Get:13 http://apt.pop-os.org/ubuntu jammy-security InRelease [129 kB]
Get:14 http://apt.pop-os.org/ubuntu jammy-updates InRelease [128 kB]
Hit:15 http://apt.pop-os.org/ubuntu jammy-backports InRelease
Get:16 http://apt.pop-os.org/proprietary jammy all Contents (deb) [160 B]
Get:17 http://apt.pop-os.org/proprietary jammy amd64 Contents (deb) [149 kB]
Get:18 http://apt.pop-os.org/ubuntu jammy i386 Contents (deb) [36.9 MB]
Get:19 http://apt.pop-os.org/ubuntu jammy amd64 Contents (deb) [46.9 MB]
Get:20 http://apt.pop-os.org/ubuntu jammy-security amd64 Contents (deb) [128 MB]
Get:21 http://apt.pop-os.org/ubuntu jammy-security i386 Contents (deb) [57.6 MB]
Get:22 http://apt.pop-os.org/ubuntu jammy-updates/main amd64 Packages [1,988 kB]
Get:23 http://apt.pop-os.org/ubuntu jammy-updates i386 Contents (deb) [59.9 MB]
Get:24 http://apt.pop-os.org/ubuntu jammy-updates amd64 Contents (deb) [132 MB]
Get:25 http://apt.pop-os.org/ubuntu jammy-backports i386 Contents (deb) [721 kB]
Get:26 http://apt.pop-os.org/ubuntu jammy-backports amd64 Contents (deb) [730 kB]
Fetched 465 MB in 1min 48s (4,318 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
48 packages can be upgraded. Run 'apt list --upgradable' to see them.
我认为从Get:13
到Get:26
都是新的,是我安装时添加的apt-file
。其中一些相当大(即 128Mb)。
我被指示使用apt-file
如下:
sudo apt-file list freecad
但是当我运行该命令时我收到消息:
$ apt-file list freecad
Finding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.
即使我刚刚更新了sudo apt-file update
我该如何撤消所有这些操作?我并不真正关心如何开始apt-file
工作。我很乐意删除它并摆脱这些额外的存储库。
我正在使用 PopOS 22.04 LTS
编辑:
:/var/lib/apt/lists$ ll | grep Contents
-rw-r--r-- 1 root root 121 Sep 4 21:46 apt.pop-os.org_proprietary_dists_jammy_Contents-all.lz4
-rw-r--r-- 1 root root 295798 Sep 4 21:46 apt.pop-os.org_proprietary_dists_jammy_Contents-amd64.lz4
-rw-r--r-- 1 root root 1228496 Jul 19 00:53 apt.pop-os.org_ubuntu_dists_jammy-backports_Contents-amd64.lz4
-rw-r--r-- 1 root root 1210558 Jul 19 00:54 apt.pop-os.org_ubuntu_dists_jammy-backports_Contents-i386.lz4
-rw-r--r-- 1 root root 78887238 Apr 21 2022 apt.pop-os.org_ubuntu_dists_jammy_Contents-amd64.lz4
-rw-r--r-- 1 root root 61822472 Apr 21 2022 apt.pop-os.org_ubuntu_dists_jammy_Contents-i386.lz4
-rw-r--r-- 1 root root 205323747 Jul 26 09:33 apt.pop-os.org_ubuntu_dists_jammy-security_Contents-amd64.lz4
-rw-r--r-- 1 root root 93188769 Jul 26 15:41 apt.pop-os.org_ubuntu_dists_jammy-security_Contents-i386.lz4
-rw-r--r-- 1 root root 211888095 Jul 26 01:31 apt.pop-os.org_ubuntu_dists_jammy-updates_Contents-amd64.lz4
-rw-r--r-- 1 root root 96983720 Jul 26 06:31 apt.pop-os.org_ubuntu_dists_jammy-updates_Contents-i386.lz4
-rw-r--r-- 1 root root 3240 Sep 4 23:00 updates.signal.org_desktop_apt_dists_xenial_main_Contents-amd64.lz4
要撤消所有这些操作,请清除
apt-file
:这将删除
apt-file
及其配置,因此将来的apt update
调用将不再下载Contents
文件。中配置要求下载额外的文件
/etc/apt/apt.conf.d/50apt-file.conf
。如果您愿意,可以保留apt-file
已安装文件,但Contents
通过添加软件包附带的另一个配置文件来禁用全面下载:一旦完成后,只有具有明确说明的存储库
[target+=Contents-deb]
才会Contents
下载文件。“缓存为空”错误相当奇怪;如果您想解决这个问题,请先查看
/var/lib/apt/lists
——那里有任何Contents
文件吗?