I wrote this up years ago, but with the demise of CrunchBang those bits are rotting away. The URL is still good, but my post is mostly gone. I just installed Debian Stretch on my Mom’s old MacBook and the issue is still there, so here it is again.
If you invoke a command that doesn’t exist, most shells will simply tell you so.
$ play play: command not found
Ubuntu has a utility called command-not-found. If you invoke a command that is not installed, but is available, it will tell you how to install it.
$ play The program 'play' is currently not installed. You can install it by typing: sudo apt install play
This command is now available in other Debian systems too, including the latest stable: stretch.
sudo apt install command-not-found sudo apt update sudo update-command-not-found
But it doesn’t quite work right, as is.
$ play The program 'play' is currently not installed. To run 'play' please ask your administrator to install package 'play'
But I am the administrator! Why doesn’t it think so? It seems that Ubuntu uses different groups than Debian. In particular, command-not-found is looking for membership in group “admin”, but Debian doesn’t use that. We want it to check for membership in group “sudo” instead. We can fix that!
sudoedit /usr/share/command-not-found/CommandNotFound/CommandNotFound.py # change "admin" to "sudo" on line 93
Most programs transition from Debian to Ubuntu. This one transitioned the other way. I guess the trip isn’t as smooth, since this was years ago and it’s still not fixed (indeed, it’s still line 93). I think this affects at least Debian wheezy, jessie, and stretch. It looks like it’s fixed on github and in Ubuntu (checks for either “admin” or “sudo”), but has not been backported to Debian yet.