When you run:
unset -f command_not_found_handleyou are removing Bash’s special function that normally catches typos or missing commands.
By default on Ubuntu (and some other distros), this function doesn’t just show a plain error — it also tries to query the package system (like APT) to suggest which package might provide that command.
Unsetting the function disables this behavior, so Bash will only display the simple error message:
bash: somecommand: command not found
👉 In short: this command turns off the “helpful but sometimes annoying” package search and keeps things clean when you mistype.
Would you like me to also show you how to make this permanent (so you don’t need to run it in every new shell)?