我想使用安装“文件”包apt,因为我的 Docker 容器缺少该file命令。在安装之前,我会检查软件包详细信息(见下文)。
我如何查看这些软件包的发布/更新日期?他们的描述说他们支持 5 年,但这毫无意义,因为我看不到他们何时发布/更新?
另外,为什么apt列出两个“文件”包?当我运行时,会安装其中哪一个apt install file?
root@eca1fcd5655a:/mnt/dotnetcore# apt show -a file
Package: file
Version: 1:5.32-2ubuntu0.3
Priority: important
Section: utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 81.9 kB
Depends: libc6 (>= 2.4), libmagic1 (= 1:5.32-2ubuntu0.3)
Homepage: http://www.darwinsys.com/file/
Task: minimal
Supported: 5y
Download-Size: 22.1 kB
APT-Sources: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
Description: Recognize the type of data in a file using "magic" numbers
Package: file
Version: 1:5.32-2
Priority: important
Section: utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 81.9 kB
Depends: libc6 (>= 2.4), libmagic1 (= 1:5.32-2)
Homepage: http://www.darwinsys.com/file/
Task: minimal
Supported: 5y
Download-Size: 22.1 kB
APT-Sources: http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Description: Recognize the type of data in a file using "magic" numbers
Run Code Online (Sandbox Code Playgroud)
五年支持期限适用于整个Ubuntu LTS 版本中受支持的软件包;何时发布或更新单个软件包\xe2\x80\x99并不重要。main首次发布发行版后五年内,存储库中的软件包会收到公开可用的安全更新。
要查看软件包的最新更改,请查看其更改日志:
\n\nzcat /usr/share/doc/${package}/changelog.Debian.gz | head -n 20\nRun Code Online (Sandbox Code Playgroud)\n\n在这种情况下,/usr/share/doc/file/changelog.Debian.gz。
您还可以使用以下命令在不安装软件包的情况下查看更改日志apt changelog:
apt changelog file\nRun Code Online (Sandbox Code Playgroud)\n\n或者查看Launchpad 上的 package\xe2\x80\x99s 页面上的版本信息。
\n\napt show -a列出了您的案例中的两个包,因为有两个版本可用,一个在主存储库中,另一个在更新存储库中。将安装的版本是两个版本中较大的一个,即更新存储库中的版本。