-8

Paying attention to:

  • Only apt
  • Not dpkg
  • Not apt-get
  • Not aptitude
Artur Meinild
  • 26,018
AlexPixel
  • 587
  • 1
  • 3
  • 11
  • 2
    You may want to check your bash history to look for instances where things were installed with apt and not apt-get, which is the exact same thing. Otherwise, if both are valid search options, there's the history.log file(s) in /var/log/apt. – matigo May 08 '22 at 00:10
  • @matigo I don't think so, there's an answer for APT – AlexPixel May 08 '22 at 00:11
  • 3
    That is a very unusual thing to want to find. Mind explaining why you want to do that? I strongly suspect you have an XY Problem here – cocomac May 08 '22 at 01:26
  • @unusual is my specialty – AlexPixel May 08 '22 at 01:50
  • 1
    I’m voting to close this question because the premise for the question does not exist - everything listed in the question uses dpkg to install packages. – Artur Meinild May 19 '22 at 11:43

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
  • 4,051
  • Note that apt keeps a log of what it installed, but dpkg does not; but you could get a list of installed packages. So at least until the apt log expires, you could cross check those and get a list of things installed with dpkg that didn't use apt. But the log is ephemeral, and you'd have to do it by process of elimination. The reverse is not possible unless there's a dpkg log I didn't notice. – user10489 May 08 '22 at 02:32
-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
  • 587
  • 1
  • 3
  • 11
  • 2
    You are incorrect in your assumptions. Finding installed packages with apt list will also list packages installed using dpkg, apt-get and aptitude, because they all install packages using dpkg as the back-end. – Artur Meinild May 19 '22 at 11:38