“systemctl: command not found” means your shell cannot locate an executable named systemctl. It does not, by itself, prove that systemd is missing. The cause is usually one of four things: the binary is outside your PATH, the systemd package is not installed, the machine uses another init system, or you are inside a container, chroot, minimal environment, or WSL setup where systemd is not PID 1.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Run the diagnostics below before installing anything. They show whether this is a path problem, a missing package, or a mismatch between the command you are using and the init system that actually controls the machine.
As an Amazon Associate I earn from qualifying purchases.
What the error actually means
When you type systemctl, the shell searches the directories listed in $PATH for an executable with that name. If it finds nothing, it prints a variant of systemctl: command not found. This lookup failure happens before systemctl can attempt to contact systemd.
That distinction matters. A system can contain the systemctl binary but have it hidden by a damaged or incomplete PATH. Conversely, a system can have a perfectly configured PATH and still not be able to use systemctl because it runs OpenRC, SysVinit, a container supervisor, or no init process at all. Installing systemd files in such an environment does not turn that environment into a systemd system.
#1 Best Overall
Use the following order: identify what the shell can see, identify PID 1, correct a path issue if the binary exists, install the systemd package only on a distribution intended to use systemd, and otherwise use the commands for the active init system.
Step 1: Diagnose the shell and PID 1
Run these commands in the same shell where the error appears:
command -v systemctl
type -a systemctl
echo "$PATH"
ps -p 1 -o comm=
How to read the results
| Result | What it indicates | Next action |
|---|---|---|
command -v prints a path such as /usr/bin/systemctl |
The executable is discoverable; the original error may have come from a different shell, user, or environment. | Run type -a systemctl and verify the failing command is being run in this same environment. |
command -v prints nothing, but /usr/bin/systemctl exists |
The binary is present but its directory is missing from $PATH. |
Repair the path as described in the next section. |
/usr/bin/systemctl does not exist |
The systemd package may be absent, or this may not be a systemd distribution. | Check PID 1 and the environment before choosing a package or an alternative command. |
PID 1 is /sbin/init or /usr/lib/systemd/systemd |
The system is using systemd as its init system (the latter path identifies systemd directly). | Fix the package or path problem; systemctl is the appropriate management interface once it is available. |
| PID 1 is something else | Another init or supervisor is managing processes. | Use that init’s service commands instead of installing systemctl merely to silence the error. |
The PID check is especially important in containers and chroots. A host may use systemd while the process you are inside has a different PID 1, so a command that works on the host can be inappropriate inside the isolated environment.
Step 2: Fix a missing or incomplete PATH
If the binary exists at /usr/bin/systemctl, the immediate fix is to add /usr/bin to the current shell’s path:
export PATH=$PATH:/usr/bin
Test the result:
command -v systemctl
systemctl --version
The export affects only the current session. To make it persistent for shells that read your startup files, add the same export line to ~/.bashrc or ~/.profile, depending on which file your shell uses. Open a new shell after saving the file and run command -v systemctl again.
Rank #2
Do not assume the binary is in /usr/bin on every installation. If that path is absent, search for it:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →find / -name systemctl
If the search returns a real executable in another directory, add that directory to PATH rather than adding a random symlink. A symlink with the name systemctl can make the shell stop reporting “command not found,” but it does not start systemd, change PID 1, or make systemctl able to manage services. It is therefore not a solution when the underlying init system is different or not running.
Step 3: Install the systemd package when the distribution uses systemd
On a Debian or Ubuntu installation intended to run systemd, the command is supplied by the systemd package. It is not normally installed from a separate package named systemctl. Install the package with:
sudo apt install systemd
On a Red Hat Enterprise Linux-based distribution, use:
sudo dnf install systemd
After installation, start a fresh shell or refresh the command lookup and verify:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #3
command -v systemctl
systemctl --version
ps -p 1 -o comm=
Package installation and init operation are separate questions. The package can place systemctl on disk while PID 1 remains a different program. In that case, the command may be found but cannot be used to control the running system. Do not keep reinstalling the package when the PID check shows that the machine is not booted with systemd.
When package installation is the wrong move
- If PID 1 is not systemd, installing systemd does not replace the active init system.
- If you are inside a container, adding systemd files does not make systemd PID 1 in that container.
- If the only problem is
PATH, reinstalling a package changes nothing about shell lookup. - If the command is found but reports that it cannot connect to systemd, you have a runtime/init problem, not a “command not found” problem.
Step 4: Use the correct commands on non-systemd systems
Linux distributions do not all use systemd. The service command must match the init system that owns PID 1.
Alpine Linux and OpenRC
Alpine uses OpenRC rather than systemd. Start a service with:
rc-service <name> start
To arrange for a service to start at boot, use:
rc-update
Replace <name> with the actual service name. Running systemctl on Alpine is the wrong interface; installing systemd solely to obtain that command does not convert the installation to OpenRC-compatible systemd management.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteSysVinit systems
On systems using SysVinit, the traditional service interface is:
service <name> start
The correct command is determined by the running init system, not by which command appears in a tutorial written for another distribution. Check PID 1 first so you do not apply OpenRC syntax to SysVinit or vice versa.
Step 5: Containers, chroots, and minimal shells
A container commonly runs an application or a small process supervisor as PID 1 instead of a full systemd instance. A chroot changes the filesystem view but does not automatically boot a new init system. Minimal shells can also omit standard directories from PATH.
Inside a container
First run the diagnostic commands inside the container, not only on the host. If PID 1 is the application, a shell, or another supervisor, systemctl is not the container’s service manager. Installing systemd inside the image adds binaries and unit files but does not make systemd PID 1.
Recommended Free Tools
Use the process supervisor chosen for that container, or manage the workload from outside it. In many deployments, the external action is to restart or recreate the container rather than start an individual daemon with systemctl. The exact command belongs to the container runtime or orchestration layer, so do not substitute a host-level systemctl command.
Inside a chroot
A chroot environment often has access to systemd files without having systemd as its own PID 1. If find / -name systemctl locates the binary but the environment has no systemd init process, treat that as an environment boundary rather than a missing executable. Run service management from the booted system, or use the mechanism provided by the environment that created the chroot.
Best Value
Minimal or restricted shells
If /usr/bin/systemctl exists and the shell cannot find it, use the temporary export first. Persist the change only in the startup file read by the affected shell. A path fixed for one interactive user does not automatically fix scripts, other users, or a container entrypoint running with a different environment.
Step 6: Fix “systemctl not found” in WSL
Windows Subsystem for Linux has a specific limitation: WSL 1 does not support systemd. Systemd requires WSL 2. Even on WSL 2, systemd must be enabled for each distribution that should use it.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Enable systemd in the distribution
- Open the Linux distribution and edit
/etc/wsl.conf. - Add this exact section and key:
[boot]
systemd=true
- Save the file and exit the distribution.
- From PowerShell, shut down the WSL virtual machine:
wsl.exe --shutdown
- Reopen the distribution, then check PID 1 and the command path:
ps -p 1 -o comm=
command -v systemctl
Simply closing a terminal window does not restart the WSL virtual machine. The explicit shutdown is what causes the configuration to be read on the next launch.
Per-distribution versus global configuration
/etc/wsl.conf applies to the individual distribution where it is stored. The Windows-side .wslconfig file applies globally to WSL settings. Do not put a per-distribution systemd setting in the global file and expect it to behave the same way.
WSL troubleshooting pitfalls
- Check spelling and capitalization of the
[boot]section andsystemd=truekey. - Make sure the file is saved inside the distribution at exactly
/etc/wsl.conf. - Use
wsl.exe --shutdown(orwsl --shutdownfrom PowerShell) instead of merely closing the shell. - Confirm you are running WSL 2; WSL 1 cannot provide systemd.
- After reopening, inspect PID 1. If it is not systemd, the configuration has not taken effect, regardless of whether the systemctl file exists.
“Command not found” versus “cannot connect to systemd”
These errors point to different layers:
| Message type | Meaning | What to inspect |
|---|---|---|
systemctl: command not found |
The shell failed to locate an executable named systemctl. |
command -v, type -a, PATH, and whether the package is installed. |
| Systemctl is found but says it cannot talk to a running systemd | The executable exists, but systemd is not running as the init system in that environment. | ps -p 1 -o comm=, container/chroot boundaries, WSL mode, and the appropriate alternative supervisor. |
Changing PATH cannot repair a missing PID 1, and installing the package cannot make a container or WSL 1 boot systemd. Resolve the layer named by the error.
Quick Recap
Practical recovery paths by scenario
Ubuntu or Debian host where /usr/bin/systemctl is missing
- Run
ps -p 1 -o comm=. If it reports/sbin/initor/usr/lib/systemd/systemd, continue. - Install the provider package with
sudo apt install systemd. - Verify
command -v systemctlandsystemctl --version. - If the command still is not found but the file exists, apply the
PATHfix.
Any system where the file exists but the command is not found
- Confirm the location with
ls -l /usr/bin/systemctlorfind / -name systemctl. - Temporarily export the containing directory, such as
export PATH=$PATH:/usr/bin. - Place the export in
~/.bashrcor~/.profileif the change must survive new sessions. - Recheck the command from the shell, script, or service account that originally failed.
Alpine host
- Confirm that PID 1 is not systemd.
- Use
rc-service <name> startfor an immediate start. - Use
rc-updatefor boot-time service configuration.
Container
- Run the PID and path diagnostics inside the container.
- If the application or a supervisor is PID 1, do not install systemd just to obtain systemctl.
- Use the container’s supervisor, or restart/recreate the container from the outside.
WSL 2 distribution
- Put
[boot]andsystemd=truein/etc/wsl.conf. - Run
wsl.exe --shutdownfrom PowerShell. - Reopen the distribution and verify PID 1.
Final checks before declaring it fixed
command -v systemctlreturns the executable you intend to use.type -a systemctldoes not reveal an unexpected older copy earlier in the path.ps -p 1 -o comm=confirms whether systemd is actually the active init.- Your service command matches that init: systemctl for systemd,
rc-service/rc-updatefor OpenRC, orservicefor SysVinit. - In WSL, the distribution is WSL 2,
/etc/wsl.confis spelled correctly, and the instance was restarted withwsl.exe --shutdown. - In a container or chroot, management is performed at the layer that owns PID 1 rather than from a host assumption.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




