The package command-not-found is now part of the default Ubuntu Desktop installation. What does the command-not-found package do ? Let’s take an example:

lionel@ouessant:~$ mutt
The program 'mutt' is currently not installed.  You can install it by typing:
sudo apt-get install mutt
bash: mutt: command not found

When a command is not found in your computer, it search in a database in which package this command is and give you the command to install it. Great isn’t it ?