如何查看包裹的来源和档案?

如何查看包裹的来源和档案?

我正在尝试弄清楚为什么软件包没有自动升级,并且我已经将目光转向了配置Allowed-Origins。但是,我不知道如何检查 apt 缓存中软件包的来源和存档。我该怎么做?

答案1

查找软件包标识(Origin、Archive 等)的方法是检查Release存储库的文件。该Release文件位于目录/var/lib/apt/lists/,并以存储库 URI 路径命名。

例如我的Debian操作系统的第三方Release文件是/var/lib/apt/lists/mirrors.ustc.edu.cn_dotdeb_packages.dotdeb.org_dists_wheezy_Release,其内容如下:

Origin: packages.dotdeb.org
Label: packages.dotdeb.org
Suite: stable
Codename: wheezy
Architectures: i386 amd64
Components: all
MD5Sum:
 7b0372c2d39e7574ff3360513577371a 90169 all/binary-amd64/Packages
 d9d802d8f7c7db495ee3d66202e757df 16777 all/binary-amd64/Packages.bz2
 c878a40df3d1c1a35a2df2bb5f1b0945 17803 all/binary-amd64/Packages.gz
 bab1973f5a315e894ba11c93476d2eea 90134 all/binary-i386/Packages
 3ad627d656bd2b663f63184a3d2dead6 16802 all/binary-i386/Packages.bz2
 9a39629120f5735e727d9c5f7b93685e 17806 all/binary-i386/Packages.gz
 f0d3d108cc53373e65bf008a454a6c9b 13431 all/source/Sources
 f52943cb088a96e24aff985ffbbb5dd2 4239 all/source/Sources.bz2
 a7cc0f55dc5d885dda5ea6fa14a20492 4291 all/source/Sources.gz
SHA1:
 0b396db57ee74d25a66c3b003dfc8df40575ec22 90169 all/binary-amd64/Packages
 9730122304e2a5018231fd9735a7cddb215b9264 16777 all/binary-amd64/Packages.bz2
 fc31511be43f3bd62509843039ae7ee5fa2e6e42 17803 all/binary-amd64/Packages.gz
 f33c1260a3db7593ef9dd7d8c8717d754d34652a 90134 all/binary-i386/Packages
 e1032286e95fb396ddef773799675e2539b8dd76 16802 all/binary-i386/Packages.bz2
 bc566974412402f959f9f519450b35151bc12c59 17806 all/binary-i386/Packages.gz
 e8b9a8c659bae2ac41187bb9bbc3e866527aaf57 13431 all/source/Sources
 2d1f8e9656c23f899d0475a5ef097b13d1724a60 4239 all/source/Sources.bz2
 0bd911daf399f742279794f6722d937420616676 4291 all/source/Sources.gz
SHA256:
 fb102dbedf57e311e9fd4694edeb856bd186e4f5301765efd8ca9210a607a3dd 90169 all/binary-amd64/Packages
 66d6eaea52e1c69fcc9ef2279bf808d8f55cdfa932e72e4fada11d2bddcda9a7 16777 all/binary-amd64/Packages.bz2
 16d5513b83fb5c442e12fb0c54bbe7fb1c065c28810b158b8f97444063af2d38 17803 all/binary-amd64/Packages.gz
 1dacf00be5f242bd89f142e1a8e6b660525398b04558ac3715b6f05746207d4c 90134 all/binary-i386/Packages
 2e3ee584d47ad2ec18b6a2b06e08facb62ed09c7c51dfde7bdc500901c475088 16802 all/binary-i386/Packages.bz2
 fea4c9c9fa10f07c2821e9e0dac464d3b6443770727a907766f98716e52425db 17806 all/binary-i386/Packages.gz
 2b124de5b3bcabe694d637621f448106787df104bcb69fbdf4c6057103347cbd 13431 all/source/Sources
 6a9ccffeb3392f8fcc158fcf8da1c2dcb2435afcc9e9d1ca7cb5d2e070e5f630 4239 all/source/Sources.bz2
 761c5d086a7b418c75e680a3d9320cb8958cb00e688a4379bb73ce967b632391 4291 all/source/Sources.gz

Unattended-Upgrade::Origins-Pattern然后我在部分中添加以下行:

        "o=packages.dotdeb.org,a=stable";

答案2

好的,我找到了一种足以满足我当前目的的方法,尽管它不够通用。我会在这里留下答案,但我不会接受它。

运行时unattended-upgrade -d,它将记录有关有可用升级的软件包的信息。此信息包含来源和存档。例如:

2010-10-27 13:21:28,734 DEBUG Checking: postgresql-8.4 (["component: 'main' archive: 'lenny-backports' origin: 'Debian Backports' label: 'Debian Backports' site 'backports.debian.org' isTrusted: 'True'"])

该脚本unattended-upgrade本身是 Python,并使用(的python-apt接口libapt-pkg)来获取该信息。

答案3

以下命令列出您配置的所有源中可用的给定软件包的所有版本sources.list

apt-cache policy <packagename>

编辑

下面是来自具有多个源的系统的示例输出sources.list

# apt-cache policy nano
nano:
  Installed: 2.0.7-5
  Candidate: 2.2.5-1
  Version table:
     2.2.5-1 0
        500 http://mirrors.kernel.org sid/main Packages
     2.2.4-1 0
        500 http://mirrors.kernel.org squeeze/main Packages
 *** 2.0.7-5 0
        500 http://mirrors.kernel.org lenny/main Packages
        100 /var/lib/dpkg/status

版本表显示可用的软件包版本、优先级、存档 URL 和套件。

相关内容