Getting command-not-found working under zsh

Solution 1:

You have to source it in your .zshrc:

if [[ -s '/etc/zsh_command_not_found' ]]; then
  source '/etc/zsh_command_not_found'
fi

The script is part of the package command-not-found:

$ apt-cache search zsh_command_not_found
> command-not-found: /etc/zsh_command_not_found