I have to analyse a lot of debian and rpm packages. I found command given above for rpm packages. This allows me to get details on content of package without downloading and directly through URI.

For eg. for rpm I can say

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

This returns name of files and its checksum for each file in examplePackage.rpm.

Do we have a similar command for debian packages?

I have looked at dpkg-query, apt-file but all of them require *deb file to present locally.

I'd like to avoid downloading and extracting all *deb files.

Thanks for any pointers and help.


apt-cache specificly show and showpkg should meet most of your listed needs. The following code result is for a package that is not installed on my system but is available. apt-cache only reads from the APT's local package cache, and could be inaccurate if not recently updated.

apt-cache showpkg 0ad
Package: 0ad
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
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)) 
0.0.20-1 - 
Reverse Provides:
apt-cache show 0ad
Package: 0ad
Priority: optional
Section: universe/games
Installed-Size: 17865
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
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
  • Thanks!. I am aware of these but these commands do not solve the issue i am facing. As you said apt-cache is still dependent on the repos configured on the system which could be a problem if repos are not updated. – explorer Dec 23 '17 at 2:41
  • I could not figure out any better way. Choosing this as suitable answer. Thanks – explorer Jan 2 '18 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.