systemctl command not found error is a common issue we face while using the Unix system like Linux, Ubuntu, or MacOS. In some cases, the error may occur if the necessary packages or dependencies for
systemctl are missing or not installed. In this post, we will learn to solve an error
systemctl: command not found.
When we try to run systemctl command to manage our services then we may face an error:
systemctl: command not found
This basically means that either the systemd package is not installed yet or there is some issue in the existing systemd package.
How to solve systemctl command not found?
To solve this issue we need to follow the following steps;
- Check whether the systemd package is installed or not.
- If it is not installed already then install it.
- If it is already installed but not working then reinstall it.
Check systemd package
We have to make sure that the
package is installed on our machine. We can verify with the command:
sudo dpkg -l | grep systemd
The output should look like the following if the
systemd package is installed.
ii libpam-systemd:amd64 204-5ubuntu20.31 amd64 system and service manager - PAM module ii libsystemd-daemon0:amd64 204-5ubuntu20.31 amd64 systemd utility library ii libsystemd-journal0:amd64 204-5ubuntu20.31 amd64 systemd journal utility library ii libsystemd-login0:amd64 204-5ubuntu20.31 amd64 systemd login utility library ii systemd 204-5ubuntu20.31 amd64 system and service manager ii systemd-services 204-5ubuntu20.31 amd64 systemd runtime services ii systemd-shim 6-2bzr1 amd64 shim for systemd
If this message does not show up then we need to install the systemd package.
Install systemd package
systemd is not installed then we can install it using the command:
sudo apt-get install systemd
After installing systemd package the error should disappear.
Reinstall systemd package
systemd is already installed and not working properly then we can reinstall it with the following command:
sudo apt-get install --reinstall systemd
After successful installation, we can now use the
systemctl command without any issues. The issue
systemctl: command not found should not come again.
What does the error message “systemctl: command not found” mean?
This error message indicates that the
systemctl command, which is used for managing system services in Linux, cannot be found or executed in your current environment.
Why am I getting the “systemctl: command not found” error?
This error typically occurs if you are not running the command as the root user or with sufficient privileges. The
systemctl command requires administrative access.
How can I check if
systemctl is installed on my Linux system?
You can check if
systemctl is installed by running the following command:
If it’s installed, this command will display the path to the
systemctl binary. If it’s not installed, you will see no output.
What should I do if
systemctl is not installed on my Linux system?
systemctl is not installed, you might be using a Linux distribution that doesn’t use systemd, or it might not be included in your minimal installation. You can try installing it with the package manager specific to your distribution. For example, on Debian/Ubuntu, you can run
sudo apt-get install systemd, and on CentOS/RHEL, you can use
sudo yum install systemd.
systemctl installed, but I still get the “command not found” error. What should I do?
systemctl is installed, but you’re still encountering this error, it’s possible that your user doesn’t have the necessary permissions to run it. Ensure that you are either logged in as the root user or use
sudo before the
systemctl command to execute it with superuser privileges.