This question already has an answer here:

I love using zsh but there is one feature that bash has that I miss. It is this one:

➜  ~  bash

dbugger@mercury:~$ man2html
The program 'man2html' is currently not installed. You can install it by typing:
sudo apt-get install man2html-base

dbugger@mercury:~$ exit
exit

➜  ~  man2html
zsh: command not found: man2html

When I type a command that is not install, but it can be easily installed, bashtells you so, but zshno.

Is there any way to fix this?

share|improve this question

marked as duplicate by Seth Jan 3 '16 at 23:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 10 down vote accepted

Make sure the command-not-found package is installed (it should be by default). Then open up your .zshrc file in your favourite text editor and append this line at the bottom:

source /etc/zsh_command_not_found  

Then run

source .zshrc  

in your terminal. Now when you try to run a program that isn't installed:

➜  ~  man2html
The program 'man2html' is currently not installed. You can install it by typing:
sudo apt-get install man2html-base
zsh: command not found: man2html
➜  ~  
share|improve this answer
    
That worked! I guess that after a reboot, I wont need to run source again. Shame that last line: zsh: command not found: man2html. If it was not there, it would be perfect. But that is probably just a small detail. Thanks! – Enrique Moreno Tent Jan 3 '16 at 23:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.