The Tech Edvocate

Top Menu

  • Advertisement
  • Apps
  • Home Page
  • Home Page Five (No Sidebar)
  • Home Page Four
  • Home Page Three
  • Home Page Two
  • Home Tech2
  • Icons [No Sidebar]
  • Left Sidbear Page
  • Lynch Educational Consulting
  • My Account
  • My Speaking Page
  • Newsletter Sign Up Confirmation
  • Newsletter Unsubscription
  • Our Brands
  • Page Example
  • Privacy Policy
  • Protected Content
  • Register
  • Request a Product Review
  • Shop
  • Shortcodes Examples
  • Signup
  • Start Here
    • Governance
    • Careers
    • Contact Us
  • Terms and Conditions
  • The Edvocate
  • The Tech Edvocate Product Guide
  • Topics
  • Write For Us
  • Advertise

Main Menu

  • Start Here
    • Our Brands
    • Governance
      • Lynch Educational Consulting, LLC.
      • Dr. Lynch’s Personal Website
      • Careers
    • Write For Us
    • The Tech Edvocate Product Guide
    • Contact Us
    • Books
    • Edupedia
    • Post a Job
    • The Edvocate Podcast
    • Terms and Conditions
    • Privacy Policy
  • Topics
    • Assistive Technology
    • Child Development Tech
    • Early Childhood & K-12 EdTech
    • EdTech Futures
    • EdTech News
    • EdTech Policy & Reform
    • EdTech Startups & Businesses
    • Higher Education EdTech
    • Online Learning & eLearning
    • Parent & Family Tech
    • Personalized Learning
    • Product Reviews
  • Advertise
  • Tech Edvocate Awards
  • The Edvocate
  • Pedagogue
  • School Ratings

logo

The Tech Edvocate

  • Start Here
    • Our Brands
    • Governance
      • Lynch Educational Consulting, LLC.
      • Dr. Lynch’s Personal Website
        • My Speaking Page
      • Careers
    • Write For Us
    • The Tech Edvocate Product Guide
    • Contact Us
    • Books
    • Edupedia
    • Post a Job
    • The Edvocate Podcast
    • Terms and Conditions
    • Privacy Policy
  • Topics
    • Assistive Technology
    • Child Development Tech
    • Early Childhood & K-12 EdTech
    • EdTech Futures
    • EdTech News
    • EdTech Policy & Reform
    • EdTech Startups & Businesses
    • Higher Education EdTech
    • Online Learning & eLearning
    • Parent & Family Tech
    • Personalized Learning
    • Product Reviews
  • Advertise
  • Tech Edvocate Awards
  • The Edvocate
  • Pedagogue
  • School Ratings
  • This One Autonomous Pharmacy Kiosk Fills Prescriptions in Under 30 Seconds

  • These 4 Game-Changing New Infosec Products Are Revolutionizing AI Security

  • 9 Critical Mistakes That Crushed Failed Proptech Startups

  • Why Your Next Nvidia Gaming Investment Might Be a Tricky Bet

  • Capcom’s Catastrophic Data Breach: What 11 Million Users Need To Do Now

  • Is the AI Bubble About to Burst? Finance Titans Clash Over Unprecedented Market Risk

  • Urgent: Rogue AI Bots Are Infiltrating Your Bank Account Right Now

  • Explosive Inquiry: Senators Demand Answers From Google Over AI in Classrooms

  • Unbelievable: White House Abandons Legal Fight, Unleashing Millions in Student Loan Forgiveness

  • Urgent: Ransomware Attacks Explode 50% — AI is the New Weapon, And It’s Targeting YOU

Digital & Mobile Technology
Home›Digital & Mobile Technology›How to Fix the “sudo: command not found” Error on Linux

How to Fix the “sudo: command not found” Error on Linux

By Matthew Lynch
August 5, 2023
0
Spread the love

Linux is an open-source operating system known for its flexibility and security, making it one of the most preferred operating systems in the world. When working with Linux, you may come across errors that need fixing to continue using this operating system optimally. One such issue is the “sudo: command not found” error. The sudo command is fundamental as it allows you to run administrative actions safely.

In this article, we’ll show you how to fix the “sudo: command not found” error on Linux.

What Causes the “sudo: command not found” Error?

The “sudo: command not found” error may occur due to several reasons, including:

  1. The sudo package is not installed: This issue primarily occurs when you’re trying to run sudo for administrative tasks, but the sudo package is not installed on your system.
  2. The sudo command is not present in the PATH variable: When you run commands in Linux, the terminal uses a PATH variable to search for available system commands. If you’re using a non-standard distribution, the PATH variable may not include the folder that contains the sudo command.
  3. The sudo command is not accessible: When the sudo binary is not executable, you’ll receive the “sudo: command not found” error.

Now that you understand what causes the error, let’s take a look at how to fix it.

Fixing the “sudo: command not found” Error1.

1.Install the sudo Package

If you’re unsure whether the sudo package is installed on your Linux distribution, you can install it by running the command below:

Debian/Ubuntu:

sudo apt-get install sudo

Fedora:

sudo dnf install sudo

CentOS/RHEL:

sudo yum install sudo

Once you’ve installed the sudo package, test it by running the command below:

sudo echo “Hello World”

If the terminal prompts you for the root password and “Hello World” is printed on the terminal output, then the sudo command is now working correctly.

2.Add the sudo Folder to the PATH Variable

If the sudo command is not in the PATH variable, you’ll have to add the folder manually.

To check the PATH variable’s contents, run the command below:

echo $PATH

If the output doesn’t have the /usr/bin/sudo folder, add it to the PATH variable by modifying the /etc/environment file. Open the file in your preferred text editor and append the following line at the end of the file:

/usr/bin/sudo

Save and exit the file and reload it by running the command below:

source /etc/environment

Test the sudo command using the process shown above.

3.Fix Sudo Binary Permissions

Sometimes, the “sudo: command not found” error may occur due to incorrect permissions set on the sudo binary. To fix it, follow the steps below:

Step 1: Locate the sudo binary file by running the command below:

whereis sudo

The output should be similar to the one below:

sudo: /usr/bin/sudo /usr/lib/sudo /usr/share/man/man8/sudo.8.gz

Step 2: After locating the sudo binary file, check the file permissions by running the command below:

ls -lah /usr/bin/sudo

Step 3: If the output shows that the sudo binary file is not set to executable, you can fix the permissions by changing them using the chmod command. Run the command below:

sudo chmod 4755 /usr/bin/sudo

The above command changes the file’s permissions, allowing the system to execute it correctly.

Previous Article

How to Fix a Windows 10 Infinite ...

Next Article

Ways to Buy Bitcoin With PayPal

Matthew Lynch

Related articles More from author

  • Digital & Mobile Technology

    How to Change Your Outlook Password

    June 12, 2023
    By Matthew Lynch
  • Digital & Mobile Technology

    How to Play Classic Super Mario Games on Your Android Device

    June 26, 2023
    By Matthew Lynch
  • Digital & Mobile Technology

    How to Fix a USB Wi-Fi Adapter That Keeps Disconnecting

    June 4, 2023
    By Matthew Lynch
  • Digital & Mobile Technology

    Integrating Technology Meaningfully With Mission Minded Learning

    March 24, 2021
    By Matthew Lynch
  • Digital & Mobile Technology

    Best Apps to Organize Your Closet and Plan Outfits

    June 15, 2023
    By Matthew Lynch
  • Digital & Mobile Technology

    Creating an Action for Batch Processing in Photoshop

    July 31, 2023
    By Matthew Lynch

Search

Login & Registration

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Newsletter

Signup for The Tech Edvocate Newsletter and have the latest in EdTech news and opinion delivered to your email address!

About Us

Since technology is not going anywhere and does more good than harm, adapting is the best course of action. That is where The Tech Edvocate comes in. We plan to cover the PreK-12 and Higher Education EdTech sectors and provide our readers with the latest news and opinion on the subject. From time to time, I will invite other voices to weigh in on important issues in EdTech. We hope to provide a well-rounded, multi-faceted look at the past, present, the future of EdTech in the US and internationally.

We started this journey back in June 2016, and we plan to continue it for many more years to come. I hope that you will join us in this discussion of the past, present and future of EdTech and lend your own insight to the issues that are discussed.

Newsletter

Signup for The Tech Edvocate Newsletter and have the latest in EdTech news and opinion delivered to your email address!

Contact Us

The Tech Edvocate
910 Goddin Street
Richmond, VA 23231
(601) 630-5238
[email protected]

Copyright © 2026 Matthew Lynch. All rights reserved.