Skip to content

How to fix ‘Sudo: systemctl: command not found’?

Linux is the only other viable operating system option right now if you don’t want to use Windows or macOS. The OS is lightweight and runs on just about anything from a powerful computer to a small credit card-sized one. 

However, that doesn’t mean it’s problem-free. In this article, we’re looking at the “sudo: systemctl: command not found” error and figuring out how to fix the problem.


Why does this happen?

Systemctl is a command-line tool used to monitor and control systemd in addition to controlling the system manager. This error is mainly caused by an older version of Linux, which uses the SysV init tool instead of systemd.

Also read: How to fix ‘Sudo command not found’ error on Linux?


How to fix this?

Here are a few simple solutions you can try out. 

Install systemd

The first thing you should do is try and install systemd. You can do this by using the following command. 

sudo apt-get install systemd
How to fix 'Sudo: systemctl: command not found'?

Once the installation is done, try running the systemctl command again to see if that solves your problem.

Also read: How to run a Cron Job every 15 minutes?


Use the service command

Another simple fix for the problem is to replace the systemctl command with the service command instead. The service command runs the SystemV init script used by older Linux distros. 

Similar to systemctl, the service command can start, restart or stop any service running on your machine. Here’s the general syntax

service [service name] [action]
How to fix 'Sudo: systemctl: command not found'?

Locate the systemd package

Another possible reason for systemctl not working could be because the package is installed elsewhere and is not added to the $PATH variable. You can check whether or not systemd is installed by using the following command.

sudo dpkg -L systemd
How to fix 'Sudo: systemctl: command not found'?

If the package is installed, you can update your $PATH variable to include its path, and you’ll be good to go.

Also read: What does ./ mean in Linux?

Hello There!

If you like what you read, please support our publication by sharing it with your friends, family and colleagues. We're an ad-supported publication. So, if you're running an Adblocker, we humbly request you to whitelist us.

We may earn a commission if you buy something from a link on this page. Thanks for your support.







>