如何在默认情况下为apt-get和apt启用--verbose-versions?


11

apt-getapt有一个非常有用的选项--verbose-versions(或-V简称),可在其输出中显示版本号。例如:

$ sudo apt dist-upgrade --verbose-versions
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
   firefox (53.0.3+build1-0ubuntu0.17.04.2 => 54.0+build3-0ubuntu0.17.04.1)
   firefox-locale-ar (53.0.3+build1-0ubuntu0.17.04.2 => 54.0+build3-0ubuntu0.17.04.1)
   firefox-locale-en (53.0.3+build1-0ubuntu0.17.04.2 => 54.0+build3-0ubuntu0.17.04.1)
   firefox-locale-es (53.0.3+build1-0ubuntu0.17.04.2 => 54.0+build3-0ubuntu0.17.04.1)
   firefox-locale-zh-hans (53.0.3+build1-0ubuntu0.17.04.2 => 54.0+build3-0ubuntu0.17.04.1)

默认情况下如何启用此选项?

Answers:


13

放...

APT::Get::Show-Versions "true"; 

在中/etc/apt/apt.conf。该文件可能还不存在。

手册页显示为“配置选项”。

/etc/apt/apt.conf

APT配置文件。配置项:Dir :: Etc :: Main。

您可能还可以使用...

/etc/apt/apt.conf.d/

APT配置文件片段。配置项:Dir :: Etc :: Parts。

并为此选项创建一个“文件片段”。


嗯。您可以不使用“;”吗?在最后?我认为这是强制性的,但现在有疑问。编辑:不可以。看起来还可以,就像我在查看此wiki.debian.org/AptConf
Rinzwind的
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.