sudo command not found - Ubuntu

Page content

How to Install sudo Command on Ubuntu

If you are trying to use the sudo command on Ubuntu and encounter a “sudo command not found” error, it means that the sudo package is not installed on your system. sudo is a command-line utility that allows users to run commands with the security privileges of another user, typically the superuser.

To install the sudo command on Ubuntu, follow these steps:

  1. Open a terminal window by pressing Ctrl + Alt + T on your keyboard.
  2. Update the package list to ensure you have the latest version of available packages by running the following command:
    sudo apt update
    
  3. Install the sudo package by running:
    sudo apt install sudo
    
  4. Confirm the installation by typing Y and pressing Enter.

Once the installation is complete, you should now be able to use the sudo command to execute administrative tasks on your Ubuntu system.

Compatibility Note:

The sudo command is a fundamental tool in Linux systems, including Ubuntu. However, if you encounter a situation where sudo is not available or compatible with your system, you can try using the su command as an alternative. The su command allows you to switch to another user account, including the superuser account, by typing:

su

You will be prompted to enter the root password to switch to the superuser account.

Conclusion:

In this tutorial, you have learned how to install the sudo command on Ubuntu to enable administrative tasks with elevated privileges. Remember to use sudo responsibly and only execute commands that you understand to avoid any potential system issues.