Command Not Found

I love this new feature in Ubuntu Feisty..

Edit: According to these pages this is also in Ubuntu Edgy (6.10), the current stable release.

If you type a command on Linux that doesn’t exist, normally you get this:-

  alan@bishop:~$ mplayer
  -bash: mplayer: command not found

With the package command-not-found installed (which is by default installed as of Ubuntu 7.04 [Feisty] [due out in April]) you get something like this:-

  alan@tigger:~$ mplayer
  The program 'mplayer' can be found in the following packages:
   * mplayer-nogui
   * mplayer
  Try: sudo apt-get install <selected package>
  Make sure you have the 'multiverse' component enabled
  -bash: mplayer: command not found

How cool is that!?

Works for loads of things. There is a database in the dependent package “command-not-found-data”.

  alan@tigger:~$ cowsay
  The program 'cowsay' is currently not installed.  You can install it by
  typing:
  sudo apt-get install cowsay
  Make sure you have the 'universe' component enabled
  -bash: cowsay: command not found

  alan@tigger:~$ figlet
  The program 'figlet' can be found in the following packages:
   * figlet
   * toilet
  Try: sudo apt-get install <selected package>
  Make sure you have the 'universe' component enabled
  -bash: figlet: command not found

Of course if you spell the command incorrectly it all goes to pot a bit:-

  alan@tigger:~$ moonbuggy
  -bash: moonbuggy: command not found

  alan@tigger:~$ moon-buggy
  The program 'moon-buggy' can be found in the following packages:
   * moon-buggy
   * moon-buggy-esd
  Try: sudo apt-get install <selected package>
  Make sure you have the 'universe' component enabled
  -bash: moon-buggy: command not found

However if you are following a tutorial or mailing list posting that suggests you run a command that doesn’t exist on your system at least it gives you a good way to solve the issue without having to search for the package containing the command.

As with all things it’s under development and may have bugs, which can be reported/viewed in launchpad:-

https://launchpad.net/ubuntu/+source/command-not-found/+bugs

This entry was posted in Advocacy, Fun, Linux, Ubuntu. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>