On Debian (and most Linux distributions), the behavior you want—where the shell suggests installing a package when a command is not found—is provided by the command-not-found package.
Install the command-not-found package:
bashsudo apt update sudo apt install command-not-found
Enable the feature:
The command-not-found package is usually enabled by default after installation. If not, ensure your shell (e.g., bash or zsh) sources the /etc/bash_command_not_found script. For bash, this is typically handled in /etc/bash.bashrc or /etc/profile.d/command-not-found.sh.
Restart your shell or open a new terminal.
Test it:
Run josm again. If the package is available in the repositories, you should see the suggestion to install it.
Check if the package is in the repositories:
Run apt search josm to confirm the package exists.
Manually source the script:
If the feature is not enabled automatically, add this line to your ~/.bashrc or ~/.zshrc:
bashsource /etc/bash_command_not_found
Then reload your shell:
bashsource ~/.bashrc
For zsh users:
Ensure the command-not-found plugin is enabled in your zsh configuration.
Vibe can make mistakes. Check answers. Learn more