Command-not-found support

We want to allow distributions to hook snapd into bash’s “command not found” support. This is the thing that, in regular Ubuntu, prints e.g.

$ httpd
No command 'httpd' found, did you mean:
 Command 'http' from package 'httpie' (universe)
 Command 'xttpd' from package 'xtide' (universe)
httpd: command not found
$

(in other distributions it can be interactive, taking you all the way through installing the package and trying the command again).

The effort has several parts. In no particular order:

  • make the data available from the store
  • on core (at least) pull the data from the store regularly, and have a minimal command_not_found_handle that serves data from there
  • look into distributing the above data via the debian mirror system, and have apt fetch it as additional metadata for the current command-not-found.
  • look into replacing the (currently too slow for core) implementation of command-not-found with the above one in general Ubuntu, consuming the same catalogs as currently.
  • support other distributions in adding support for the additional source of packages in command-not-found. SuSE and Fedora do their own thing (and Fedora currently uses packagekit which is single-source, but is moving to just using gnome-software as a backend? perhaps not as the startup time would be a killer). We’re hopeful (but perhaps delusional) that the above faster command-not-found would be good enough to be cross-distro, in the fullness of time.

Last updated 1 year, 2 months ago. Help improve this document in the forum.