如何在没有 Debian 工具的情况下读取 deb 软件包的版本?

Wil*_*iam 5 package-management deb

在 Archlinux 中,我可以打开一个包,它只是一个.tar.xz.,然后阅读.PKGINFO文件以找出我下载的软件版本。

但是,如果我有一个mysoftware-unstable.deb文件,则不清楚我必须在哪里查看才能知道版本(或者是否可以阅读它)。

请注意,我没有 Ubuntu,也没有apt-get诸如此类,我只有一个.deb文件。

Rob*_*rtL 6

您可以.deb使用artar命令读取 Debian软件包的版本,如果未安装,几乎所有系统上都可以使用这些命令。

以下管道control在标准输出上打印 Debian 包文件:

ar p mysoftware-unstable.deb control.tar.gz | tar xzOf - ./control
Run Code Online (Sandbox Code Playgroud)

control文件包含一个Version字段。此示例显示controlgoogle-chrome-unstable包的文件:

$ wget https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
$ ar p google-chrome-unstable_current_amd64.deb control.tar.gz | tar xzOf - ./control
Package: google-chrome-unstable
Version: 50.0.2638.0-1
Architecture: amd64
Maintainer: Chrome Linux Team <chromium-dev@chromium.org>
Installed-Size: 180324
Pre-Depends: dpkg (>= 1.14.0)
Depends: gconf-service, libasound2 (>= 1.0.23), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.12), libcairo2 (>= 1.6.0), libcups2 (>= 1.4.0), libdbus-1-3 (>= 1.2.14), libexpat1 (>= 1.95.8), libfontconfig1 (>= 2.8.0), libfreetype6 (>= 2.3.9), libgcc1 (>= 1:4.1.1), libgconf-2-4 (>= 2.31.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.26.0), libgtk2.0-0 (>= 2.24.0), libnspr4 (>= 1.8.0.10), libnss3 (>= 3.17.2), libpango1.0-0 (>= 1.14.0), libstdc++6 (>= 4.8.0), libx11-6 (>= 2:1.4.99.1), libxcomposite1 (>= 1:0.3-1), libxcursor1 (>> 1.1.2), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxi6 (>= 2:1.2.99.4), libxrandr2 (>= 2:1.2.99.2), libxrender1, libxss1, libxtst6, ca-certificates, fonts-liberation, libappindicator1, libcurl3, lsb-base (>= 4.1), xdg-utils (>= 1.0.2), wget
Provides: www-browser
Section: web
Priority: optional
Description: The web browser from Google
 Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier.
Run Code Online (Sandbox Code Playgroud)


Ven*_*atC 1

尝试此页面https://blogs.oracle.com/ksplice/entry/anatomy_of_a_debian_package中的信息,使用artar 来提取 pkg,我可以在下面看到 google-chrome deb pkg

$ cat control
Package: google-chrome-unstable
Version: 48.0.2564.22-1
Architecture: amd64
Run Code Online (Sandbox Code Playgroud)