Ubuntu

List installed packages

1
  apt list --installed

Search for a filename from installed pacakges

1
  dpkg -S $(which top)