check_latest_version && sudo apt update && sudo apt upgrade -y
Verify the command name is correct:
which command_name
type command_name
whereis command_name
Install the package containing the command:
sudo apt install package_name
sudo yum install package_name
command-not-found command_name
Verify command location is in PATH:
echo $PATH
export PATH=$PATH:/new/directory
hash -r
This error occurs when bash cannot locate the specified command in the system PATH or the command doesn't exist.
echo $SHELL
ls -la /usr/bin/command
find /usr -name command_name
dpkg -S command_name