在尝试安装之前验证 deb 包

在尝试安装之前验证 deb 包

总结 如何验证 deb 文件是否完整且没有错误?

我下载的 deb 包不完整,安装时会出错。在尝试安装之前,我想检查它是否有效。如如何在安装前检查并验证 deb 包,我可以使用,dpkg-deb --info <deb file>但是这会提供所有信息,但不会在我的文件上显示任何错误。

在我的特定情况下,我有以下文件

# file is actually ~40MB, download the first 27MB
curl -r 0-28208916 https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce-cli_20.10.21~3-0~ubuntu-jammy_amd64.deb

下面显示了 deb 的信息,但没有报告文件不完整

dpkg-deb --info docker-ce-cli_20.10.21~3-0~ubuntu-jammy_amd64.deb

dpkg-deb 命令的输出,

 new Debian package, version 2.0.
 size 28208917 bytes: control archive=5436 bytes.
    1059 bytes,    24 lines      control
   14836 bytes,   195 lines      md5sums
 Package: docker-ce-cli
 Source: docker-ce
 Version: 5:20.10.21~3-0~ubuntu-jammy
 Architecture: amd64
 Maintainer: Docker <[email protected]>
 Installed-Size: 145640
 Depends: libc6 (>= 2.34)
 Recommends: docker-scan-plugin
 Conflicts: docker (<< 1.5~), docker-engine, docker-engine-cs, docker.io, lxc-docker, lxc-docker-virtual-package
 Breaks: docker-ce (<< 5:0)
 Replaces: docker-ce (<< 5:0)
 Section: admin
 Priority: optional
 Homepage: https://www.docker.com
 Description: Docker CLI: the open-source application container engine
  Docker is a product for you to build, ship and run any application as a
  lightweight container
  .
  Docker containers are both hardware-agnostic and platform-agnostic. This means
  they can run anywhere, from your laptop to the largest cloud compute instance and
  everything in between - and they don't require you to use a particular
  language, framework or packaging system. That makes them great building blocks
  for deploying and scaling web apps, databases, and backend services without
  depending on a particular stack or provider.

相关内容