I’ve been quietly admiring the Debian BASH command not found functionality for a while. For those unfamiliar with the functionality, it suggests installing packages if you typed a command that is not installed. It also seemed to be pretty helpful suggesting replacements for typos.
When Rahul opened a bug to include this in Fedora, I figured this is just the sort of thing a framework like PackageKit needs to hook into. Roman Rakus put a simple patch in Fedora for bash, and now we’ll try to get it upstream. Then it will work on all distros that support PackageKit.
I spent this afternoon hacking a simple implementation. It’s up to the distro whether it should be installed by default on a base install. It’s also pretty configurable, so if you just want it to launch lshal everytime you type lshla, you can have that. If you want it to ask you before it installs shed to provide /usr/bin/shed, then that’s possible too. The simple configuration file is available here for review.
There’s also a screencast available if you want to see all the hotness.