“rpm -qp --queryformat” 的类似命令是什么

“rpm -qp --queryformat” 的类似命令是什么

我必须分析很多 debian 和 rpm 包。我找到了上面给出的用于 rpm 包的命令。这使我无需下载即可直接通过 URI 获取包内容的详细信息。

例如,对于 rpm,我可以说

rpm -qp --queryformat "[%{FILENAMES} %{FILEMD5S} \n ] "http://somepath.com/examplePackage.rpm

这将返回 examplePackage.rpm 中每个文件的文件名及其校验和。

我们是否有针对 Debian 软件包的类似命令?

我查看过 dpkg-query、apt-file,但它们都需要 *deb 文件在本地呈现。

我想避免下载和提取所有 *deb 文件。

谢谢您的任何指点和帮助。

答案1

apt-cache具体来说show,应该showpkg 可以满足您列出的大多数需求。以下代码结果适用于我的系统上未安装但可用的软件包。apt-cache仅从 APT 的本地软件包缓存中读取,如果最近没有更新,则可能不准确。

apt-cache showpkg 0ad
Package: 0ad
Versions: 
0.0.20-1 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial_universe_binary-amd64_Packages)
 Description Language: 
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial_universe_binary-amd64_Packages
                  MD5: d943033bedada21853d2ae54a2578a7b
 Description Language: 
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial_universe_binary-i386_Packages
                  MD5: d943033bedada21853d2ae54a2578a7b
 Description Language: en
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial_universe_i18n_Translation-en
                  MD5: d943033bedada21853d2ae54a2578a7b


Reverse Depends: 
  0ad-dbg,0ad 0.0.20-1
  0ad:i386,0ad
  games-strategy,0ad
  games-finest,0ad
  games-c++-dev,0ad
  0ad-data,0ad
  0ad-data-common,0ad
Dependencies: 
0.0.20-1 - dpkg (2 1.15.6~) 0ad-data (2 0.0.20) 0ad-data (1 0.0.20-1) 0ad-data-common (2 0.0.20) 0ad-data-common (1 0.0.20-1) libboost-filesystem1.58.0 (0 (null)) libc6 (2 2.15) libcurl3-gnutls (2 7.16.2) libenet7 (0 (null)) libgcc1 (2 1:3.4) libgl1-mesa-glx (16 (null)) libgl1 (0 (null)) libgloox13v5 (0 (null)) libicu55 (2 55.1-1~) libminiupnpc10 (2 1.9.20140610) libnspr4 (2 2:4.9.2) libnvtt2 (0 (null)) libopenal1 (2 1.14) libpng12-0 (2 1.2.13-4) libsdl2-2.0-0 (2 2.0.4) libstdc++6 (2 5.2) libvorbisfile3 (2 1.1.2) libwxbase3.0-0v5 (2 3.0.2+dfsg) libwxgtk3.0-0v5 (2 3.0.2+dfsg) libx11-6 (0 (null)) libxcursor1 (4 1.1.2) libxml2 (2 2.9.0) zlib1g (2 1:1.2.0) 0ad:i386 (32 (null)) 
Provides: 
0.0.20-1 - 
Reverse Provides:
apt-cache show 0ad
Package: 0ad
Priority: optional
Section: universe/games
Installed-Size: 17865
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Games Team <[email protected]>
Architecture: amd64
Version: 0.0.20-1
Depends: 0ad-data (>= 0.0.20), 0ad-data (<= 0.0.20-1), 0ad-data-common (>= 0.0.20), 0ad-data-common (<= 0.0.20-1), libboost-filesystem1.58.0, libc6 (>= 2.15), libcurl3-gnutls (>= 7.16.2), libenet7, libgcc1 (>= 1:3.4), libgl1-mesa-glx | libgl1, libgloox13v5, libicu55 (>= 55.1-1~), libminiupnpc10 (>= 1.9.20140610), libnspr4 (>= 2:4.9.2), libnvtt2, libopenal1 (>= 1.14), libpng12-0 (>= 1.2.13-4), libsdl2-2.0-0 (>= 2.0.4), libstdc++6 (>= 5.2), libvorbisfile3 (>= 1.1.2), libwxbase3.0-0v5 (>= 3.0.2+dfsg), libwxgtk3.0-0v5 (>= 3.0.2+dfsg), libx11-6, libxcursor1 (>> 1.1.2), libxml2 (>= 2.9.0), zlib1g (>= 1:1.2.0)
Pre-Depends: dpkg (>= 1.15.6~)
Filename: pool/universe/0/0ad/0ad_0.0.20-1_amd64.deb
Size: 5071640
MD5sum: 205c3197b2a807d2bf455e138f8332a5
SHA1: c64a2e29ebb7cec741c21b703b935ef5ff3c412f
SHA256: 006fa3e766cc601510d78861ac2f15d20de0373404ac26fb95a0e943ee38977f
Description-en: Real-time strategy game of ancient warfare
 0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
 real-time strategy (RTS) game of ancient warfare. In short, it is a
 historically-based war/economy game that allows players to relive or rewrite
 the history of Western civilizations, focusing on the years between 500 B.C.
 and 500 A.D. The project is highly ambitious, involving state-of-the-art 3D
 graphics, detailed artwork, sound, and a flexible and powerful custom-built
 game engine.
Description-md5: d943033bedada21853d2ae54a2578a7b
Homepage: http://play0ad.com/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

相关内容