Can I configure apt to display package version on install confirmation?

When using yum or dnf, there is a transaction summary before asking for confirmation to install or update packages, like this:

 Package                     Arch                   Version                                  Repository            Size
 nodejs                      x86_64                 1:6.14.3-1.el7                           epel                 4.7 M
 npm                         x86_64                 1:3.10.10-                 epel                 2.5 M
Installing for dependencies:
 http-parser                 x86_64                 2.7.1-5.el7_4                            base                  28 k
 libuv                       x86_64                 1:1.23.2-1.el7                           epel                 129 k

Transaction Summary
Install  2 Packages (+2 Dependent packages)

When using apt/apt-get, the summary looks like this instead:

The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dpkg-dev fakeroot g++ g++-7 gcc gcc-7
  gcc-7-base gyp javascript-common libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4
  libatomic1 libbinutils libc-ares2 libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libdpkg-perl libfakeroot
  libfile-fcntllock-perl libgcc-7-dev libgomp1 libhttp-parser2.7.1 libisl19 libitm1 libjs-async libjs-inherits
  libjs-jquery libjs-node-uuid libjs-underscore liblsan0 libmpc3 libmpx2 libpython-stdlib libpython2.7-minimal
  libpython2.7-stdlib libquadmath0 libssl1.0-dev libstdc++-7-dev libtsan0 libubsan0 libuv1-dev linux-libc-dev make
  manpages-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-balanced-match node-block-stream
  node-brace-expansion node-builtin-modules node-combined-stream node-concat-map node-cookie-jar node-delayed-stream
  node-forever-agent node-form-data node-fs.realpath node-fstream node-fstream-ignore node-github-url-from-git
  node-glob node-graceful-fs node-gyp node-hosted-git-info node-inflight node-inherits node-ini node-is-builtin-module
  node-isexe node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp
  node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv
  node-path-is-absolute node-pseudomap node-qs node-read node-read-package-json node-request node-retry node-rimraf
  node-semver node-sha node-slide node-spdx-correct node-spdx-expression-parse node-spdx-license-ids node-tar
  node-tunnel-agent node-underscore node-validate-npm-package-license node-which node-wrappy node-yallist nodejs
  nodejs-dev nodejs-doc npm python python-minimal python-pkg-resources python2.7 python2.7-minimal
0 upgraded, 125 newly installed, 0 to remove and 0 not upgraded.
Need to get 2587 kB/51.1 MB of archives.
After this operation, 227 MB of additional disk space will be used.

As you can see, the version to be installed is unclear in the situation. I may want to add a different repo if the latest package in the official repo is not the one I need. So in this situation, I have to run apt-cache policy to verify the package version first.

My question is: is the format of this confirmation configurable in any way? Can I make it display package version just like yum did?

Leave a Reply

Your email address will not be published. Required fields are marked *