Wednesday, April 6, 2022

[SOLVED] Version of Linux Mint apt itself

Issue

How do you check the version of apt package manager on Linux Mint? I'm not talking about the packages, but the apt itself. For instance, for dpkg,

dpkg --version

returns its correct version. Is there an equivalent for apt?


Solution

As for some reason apt --version does not seem to work for you, you can check via apt list, which version of apt is installed:

apt list --installed 2>/dev/null | grep ^apt/

On my Ubuntu 20.10, the result is apt/groovy,now 2.1.10 amd64 [installed,automatic], so the version is 2.1.10 (which is also what apt --version is telling me).

Explanation:

  1. apt list --installed shows all installed packages.
  2. 2>/dev/null silences the warning that apt always shows when it is used in pipes (just for convenience, not necessary)
  3. grep ^apt/ filters out all lines which do not start with apt/, so you don't have to scroll through all installed packages


Answered By - Niklas Mertsch
Answer Checked By - Terry (WPSolving Volunteer)