(Solved): systemctl command not found

The systemctl command not found error is a common issue we face while using the Linux. 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;

  1. Check whether the systemd package is installed or not.
  2. If it is not installed already then install it.
  3. If it is already installed but not working then reinstall it.

Check systemd package

We have to make sure that the systemd 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

If the 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.

If the systemd package is already installed in the system and it still shows an error message systemctl: command not found then we need to reinstall systemd package.

Reinstall systemd package

If 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.

Frequently Asked Questions (FAQs)

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:
which systemctl.
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?

If 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.

I have systemctl installed, but I still get the “command not found” error. What should I do?

If 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.

Sharing Is Caring:
Subscribe
Notify of
0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments