如何在安装前检查和验证 deb 包?

Liv*_*eBT 26 package-management dpkg

我想.deb在安装之前尽可能多地了解一个包。在常规包构建期间会生成大量元数据,我知道也有签名包,例如来自分发存储库的包。

这不是我要找的答案。当然,我可以使用 file-roller 打开包并通过这种方式找到构建日期,但我想超越它。我想到了一些类似于您在 Firefox 中检查 TLS 证书的方式。

关键问题:

  • 包是什么时候构建的?
  • 如果可能的话,这个包是由谁或在哪里构建的?
  • 依赖关系是什么?(链接到完整的好答案。)
  • 包裹签了吗?
    • 谁或什么签署了它?

关于最后一点,我了解.dsc文件,尽管 3rd 方网站通常不提供这些文件。(也许我们应该在这里提高认识,以便将来改变这种情况。)

您可以使用 google-chrome 作为 3rd 方软件包的示例。

小智 22

用这个:

dpkg-deb --info <deb file>
Run Code Online (Sandbox Code Playgroud)

如果您需要对它们进行签名,最好使用 apt。


Pil*_*ot6 12

普通的 deb 文件不包含您需要的所有数据,除非您可以通过dpkg-deb --info或查看DEBIAN/control文件。

如果您从启动板或官方存储库下载,您可以拥有包含此数据的 dsc 文件。

默认情况下不对 Deb 文件进行签名。一般建议不要从您不信任的站点安装 deb 包。

Debian 软件包中没有特殊的安全工具。


Mar*_*rby 7

所有你应该需要的是

dpkg -I package.deb
Run Code Online (Sandbox Code Playgroud)

这是hostapd_2.1-0ubuntu1.2_amd64.deb在我的 PC 上命名的包的示例输出

 ~$ dpkg -I '/home/mark/hostapd_2.1-0ubuntu1.2_amd64.deb' 
 new debian package, version 2.0.
 size 422472 bytes: control archive=2619 bytes.
      66 bytes,     3 lines      conffiles            
    1537 bytes,    31 lines      control              
    1085 bytes,    15 lines      md5sums              
    1375 bytes,    53 lines   *  postinst             #!/bin/sh
     359 bytes,    14 lines   *  postrm               #!/bin/sh
     570 bytes,    30 lines   *  preinst              #!/bin/sh
     204 bytes,     7 lines   *  prerm                #!/bin/sh
 Package: hostapd
 Source: wpa (2.1-0ubuntu1.2)
 Version: 1:2.1-0ubuntu1.2
 Architecture: amd64
 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
 Installed-Size: 1219
 Depends: libc6 (>= 2.15), libnl-3-200 (>= 3.2.7), libnl-genl-3-200 (>= 3.2.7), libssl1.0.0 (>= 1.0.1), lsb-base (>= 3.2-13), initscripts (>= 2.88dsf-13.3)
 Section: net
 Priority: optional
 Multi-Arch: foreign
 Homepage: http://w1.fi/wpa_supplicant/
 Description: user space IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
  Originally, hostapd was an optional user space component for Host AP
  driver. It adds more features to the basic IEEE 802.11 management
  included in the kernel driver: using external RADIUS authentication
  server for MAC address based access control, IEEE 802.1X Authenticator
  and dynamic WEP keying, RADIUS accounting, WPA/WPA2 (IEEE 802.11i/RSN)
  Authenticator and dynamic TKIP/CCMP keying.
  .
  The current version includes support for other drivers, an integrated
  EAP authenticator (i.e., allow full authentication without requiring
  an external RADIUS authentication server), and RADIUS authentication
  server for EAP authentication.
  .
  hostapd works with the following drivers:
  .
   * mac80211 based drivers with support for master mode [linux]
   * Host AP driver for Prism2/2.5/3 [linux]
   * Driver interface for FreeBSD net80211 layer [kfreebsd]
   * Any wired Ethernet driver for wired IEEE 802.1X authentication.
 Original-Maintainer: Debian/Ubuntu wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>
Run Code Online (Sandbox Code Playgroud)

另一个随机调用 pulseaudio_6.0-90-g75dd2-1_amd64.deb

~$ dpkg -I '/home/mark/pulseaudio/pulseaudio_6.0-90-g75dd2-1_amd64.deb' 
 new debian package, version 2.0.
 size 1421422 bytes: control archive=314 bytes.
       0 bytes,     0 lines      conffiles            
     222 bytes,     9 lines      control              
 Package: pulseaudio
 Priority: extra
 Section: checkinstall
 Installed-Size: 8144
 Maintainer: root@Ubuntu
 Architecture: amd64
 Version: 6.0-90-g75dd2-1
 Provides: pulseaudio
 Description: Package created with checkinstall 1.6.2
Run Code Online (Sandbox Code Playgroud)