AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 783172
Accepted
iamthebull
iamthebull
Asked: 2024-09-08 01:22:38 +0800 CST2024-09-08 01:22:38 +0800 CST 2024-09-08 01:22:38 +0800 CST

我该如何修复 apt-file?- 无法正常工作并添加了额外的存储库

  • 772

我正在寻找一种方法来查找 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
ubuntu
  • 1 1 个回答
  • 150 Views

1 个回答

  • Voted
  1. Best Answer
    Stephen Kitt
    2024-09-08T02:14:20+08:002024-09-08T02:14:20+08:00

    要撤消所有这些操作,请清除apt-file:

    sudo apt purge apt-file
    

    这将删除apt-file及其配置,因此将来的apt update调用将不再下载Contents文件。

    中配置要求下载额外的文件/etc/apt/apt.conf.d/50apt-file.conf。如果您愿意,可以保留apt-file已安装文件,但Contents通过添加软件包附带的另一个配置文件来禁用全面下载:

    sudo cp /usr/share/doc/apt-file/examples/60disable-contents-fetching.conf /etc/apt/apt.conf.d
    

    一旦完成后,只有具有明确说明的存储库[target+=Contents-deb]才会Contents下载文件。

    “缓存为空”错误相当奇怪;如果您想解决这个问题,请先查看/var/lib/apt/lists——那里有任何Contents文件吗?

    • 4

相关问题

  • 使 Apple 键盘设置在 ../hid_apple/parameters/ 中持久化

  • 用文件中的点绘制二维图形

  • 如何验证我使用 9.9.9.9 作为 DNS?

  • 并行安装多个 linux 发行版

  • 自编译 OpenVPN 不会从 systemd 启动

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve