1

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
========================================================================================================================
Installing:
 nodejs                      x86_64                 1:6.14.3-1.el7                           epel                 4.7 M
 npm                         x86_64                 1:3.10.10-1.6.14.3.1.el7                 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 <package> 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?

  • 1
    No, the format is not configurable. Apt's default setting is to assume that you always want the highest version available, and that beyond 'highest' you don't particularly care what that version number is. In the Debian/Ubuntu ecosystem, a dependency upon an unusual, non-release package version is considered a bug (and rather gauche). – user535733 Nov 11 '18 at 2:43
  • I've edited my answer to highlight the use of -s. – DK Bose Nov 12 '18 at 2:06
1

As a workaround, first run the intended command in simulation mode by using -s. In the code below, I want to know what will be installed on my Kubuntu 18.04 if I install gedit:

$ apt install -s gedit
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gedit-common gir1.2-gtksource-3.0 gir1.2-peas-1.0 libgspell-1-1 libgspell-1-common libpeas-1.0-0 libpeas-common
Suggested packages:
  gedit-plugins
The following NEW packages will be installed:
  gedit gedit-common gir1.2-gtksource-3.0 gir1.2-peas-1.0 libgspell-1-1 libgspell-1-common libpeas-1.0-0 libpeas-common
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Inst libgspell-1-common (1.6.1-1 Ubuntu:18.04/bionic [all])
Inst libgspell-1-1 (1.6.1-1 Ubuntu:18.04/bionic [amd64])
Inst libpeas-common (1.22.0-2 Ubuntu:18.04/bionic [all])
Inst libpeas-1.0-0 (1.22.0-2 Ubuntu:18.04/bionic [amd64])
Inst gir1.2-gtksource-3.0 (3.24.7-1 Ubuntu:18.04/bionic [amd64])
Inst gedit-common (3.28.1-1ubuntu1 Ubuntu:18.04/bionic [all])
Inst gir1.2-peas-1.0 (1.22.0-2 Ubuntu:18.04/bionic [amd64])
Inst gedit (3.28.1-1ubuntu1 Ubuntu:18.04/bionic [amd64])
Conf libgspell-1-common (1.6.1-1 Ubuntu:18.04/bionic [all])
Conf libgspell-1-1 (1.6.1-1 Ubuntu:18.04/bionic [amd64])
Conf libpeas-common (1.22.0-2 Ubuntu:18.04/bionic [all])
Conf libpeas-1.0-0 (1.22.0-2 Ubuntu:18.04/bionic [amd64])
Conf gir1.2-gtksource-3.0 (3.24.7-1 Ubuntu:18.04/bionic [amd64])
Conf gedit-common (3.28.1-1ubuntu1 Ubuntu:18.04/bionic [all])
Conf gir1.2-peas-1.0 (1.22.0-2 Ubuntu:18.04/bionic [amd64])
Conf gedit (3.28.1-1ubuntu1 Ubuntu:18.04/bionic [amd64])
$ 

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.