-8

Paying attention to:

  • Only apt
  • Not dpkg
  • Not apt-get
  • Not aptitude
Artur Meinild
  • 31,035
AlexPixel
  • 637

2 Answers2

5

There is no such thing, because apt doesn't install packages, it finds and downloads packages to install and their dependencies and then gives them to dpkg to install. So all packages installed with apt are actually installed with dpkg.

See also:

user10489
  • 5,533
-5

1_ there's such thing

It supports glob patterns for matching package names as well as options to list:

  1. installed (--installed)
  2. upgradeable (--upgradeable)
  3. all available (--all-versions) versions.

search for all packages:

apt list 

search for a package installed or not

apt list <package-name>
apt list gnome-calculator #example

returns

gnome-calculator/jammy,now 1:41.1-2ubuntu2 amd64 [installed,automatic]

2_ even deeper [show installed and upgradable]

apt list -a google-chrome-stable

returns

google-chrome-stable/stable 101.0.4951.54-1 amd64 [upgradable from: 101.0.4951.41-1]
google-chrome-stable/now 101.0.4951.41-1 amd64 [installed,upgradable to: 101.0.4951.54-1]

  1. apt list is similar to dpkg-query dpkg -s but with dpkg is longer and needs to uses other tooling to filter result like grep.
dpkg -s google-chrome-stable | grep "Status"` //with dpkg
Status: install ok installed //returns 
AlexPixel
  • 637