Ubuntu – How to enable –verbose-versions for apt-get and apt by default


apt-get and apt have a very useful option --verbose-versions (or -V for short) that shows you version numbers in its output. For instance:

$ 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)

How can I enable this option by default?

Best Answer

Put ...

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

in /etc/apt/apt.conf. That file probably does not exist yet.

Man page shows that as the "configuration option".


APT configuration file. Configuration Item: Dir::Etc::Main.

You probably can also use ...


APT configuration file fragments. Configuration Item: Dir::Etc::Parts.

and create a "file fragment" for this option.