In this post, we will learn to solve an error systemctl: command not found
. The systemctl command is a utility command in Linux that is responsible for controlling the systemd system and service manager. The systemctl: command not found is a common issue we face while using Linux.
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.
Hence, we have to make sure that the
package is installed on our machine. We can verify with the command:systemd
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 the systemd
is not installed then we can install it using the command:
sudo apt-get install systemd
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 issue. The issue systemctl: command not found should not come again.