Enhanced Command-Not-Found Hook in Ubuntu 9.10
One of the less prominent Ubuntu features that has received an overhaul for Karmic is the command-not-found handle, which helps users find the program they’re looking for when they type an unrecognized command in the terminal. Following is a brief outline of improvements made to this tiny utility, and why they matter.
In previous versions of Ubuntu, the command-not-found handle hooked into the bash shell to suggest which packages to install when a user tried to run a binary that existed in the official Ubuntu repositories but was not installed on the local system.
In Karmic, this functionality has been enhanced in two ways. First, users are now instructed not only as to which package they need to install, but also which repository to find it in. Here’s an example:
chris@chris-desktop:~$ aircrack-ng
The program 'aircrack-ng' is currently not installed. You can install it by typing:
sudo apt-get install aircrack-ng
You will have to enable the component called 'universe'
bash: aircrack-ng: command not found
It would be nice if the output were a little clearer about what a “component” is and how to enable it, but this is still helpful.
The second neat addition to the utility is an ability to catch typos, e.g.:
chris@chris-desktop
:~$ gdit
No command 'gdit' found, did you mean:
Command 'edit' from package 'mime-support' (main)
Command 'gdis' from package 'gdis' (universe)
Command 'git' from package 'git-core' (main)
Command 'gedit' from package 'gedit' (main)
bash: gdit: command not found
Why it matters
The command-not-found feature is hardly a make-or-break component of the operating system. But as I wrote a few months ago, it’s little touches like these that make Ubuntu and its derivatives stand out for their ease of use and work in catering to Linux neophytes.
The enhancements to this tiny utility in Ubuntu 9.10 go even further in helping users feel comfortable while exploring the command line. By itself, the command-not-found handle is not going to revolutionize anyone’s Ubuntu experience. But small features like this highlight Ubuntu’s focus on usability in a software ecosystem where geeky developers are too often out of touch with mainstream users, and assure non-geeks that Ubuntu can work for them, too.
Great! These are the kinds of things that Ubuntu needs to improve if Linux is ever going to be relevant on the desktop.
An improvement: It should also output the AptURL link to install the package and enable the repository with a click. (https://wiki.ubuntu.com/AptUrl#Enabling repositories) You can right-click links in the terminal to launch them.
Fish shell’s syntax highlighting and smarter tab completion would be a great addition, too, but there are unfortunately a large number of people who think unenhanced bash is the pinnacle of command line interaction. (Of course many of them install all kinds of helper scripts and configuration tweaks to make bash more usable for *themselves*, but they absolutely refuse to change the way it comes out of the box.)
It would be even better if not only suggesting which missing package to install, but also doing it automatically:
chris@chris-desktop:~$ aircrack-ng
The program ‘aircrack-ng’ is currently not installed. You can install it by typing:
sudo apt-get install aircrack-ng
Would you like to install it now? [Y/N]
Although I think it should be a bit more different – not stopping for user input, probably caching it for afterward use:
chris@chris-desktop:~$ y
gt;gt;You will have to enable the component called ‘universe’
gt; It would be nice if the output were a little clearer about what a “component” is and how to enable it, but this is still helpful.
Uh, no, it’s not helpful. If the user already doesn’t understand the simple message provided today, how could this more confusing message possibly help?
Is this actually a problem? The output of command-not-found is already quite clear.
Reminds me of the geniuses at Microsoft who created the annoying “Clippy” because they didn’t think their users were smart enough to use the “Help” menu.
[…] Enhanced Command-Not-Found Hook in Ubuntu 9.10 One of the less prominent Ubuntu features that has received an overhaul for Karmic is the command-not-found handle, which helps users find the program they’re looking for when they type an unrecognized command in the terminal. Following is a brief outline of improvements made to this tiny utility, and why they matter. […]
[…] Visto en | WorkswithU […]
Well, the feature is surely very useful and all. But i doubt how it will improve the user experience. Coz, whoever uses command line generally knows enough to not require anyone telling why the command was not found. Secondly, the help that is being shown wont help a non-geeky user IMHO.
So, what i feel is that instead, Ubuntu should focus more on the GUI aspect than such petty things. I am sure there’s a lot of scope for improvement in the GUI.
@Natthu:
There’s a more fundamental discussion here. How important is cmdline access for day to day operations for people who are unfamiliar with an Ubuntu system? It’s probably more than you realize.
For example, a lot of peer community help that is available in a forum,mailinglist, blog, or irc log involves commandline usage. Since most avenues of community communication are essentially text based..commandline based instructions are more easily communicated in those mediums. Point and click instructions are difficult to communicate well outside of a screencast or image slideshow.
If novice users reach out to a community support channel they are likely going to get a crash course in commandline usage as part of the lingo of peer support. From that point of view, this feature will lower the learning curve a bit and make it easier for people seeking out community support to make use of the instructions they find archived in places like a forum.
-jef
I had to uninstall command-not-found because it caused my OpenSuse 11.1 to delay half a second each time I misspelled a command.
thank you very very very much for the help!
uninstall command-not-found!
should have thought of it myself!
i am not a perfect typist and
it was driving me crazy.
Thank you Daniel. Just ugraded and this is incredibly annoying. Very windows-like.