October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Fix “systemctl: command not found” on Linux

Learn why Linux cannot find systemctl and follow the correct fix for PATH errors, missing systemd packages, non-systemd distributions, containers, chroots, and WSL 2.
Length8 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Do not assume the binary is in /usr/bin on every installation. If that path is absent, search for it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable systemd in the distribution

  1. Open the Linux distribution and edit /etc/wsl.conf.
  2. Add this exact section and key:
[boot]
systemd=true
  1. Save the file and exit the distribution.
  2. From PowerShell, shut down the WSL virtual machine:
wsl.exe --shutdown
  1. 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 and systemd=true key.
  • Make sure the file is saved inside the distribution at exactly /etc/wsl.conf.
  • Use wsl.exe --shutdown (or wsl --shutdown from 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.

Practical recovery paths by scenario

Ubuntu or Debian host where /usr/bin/systemctl is missing

  1. Run ps -p 1 -o comm=. If it reports /sbin/init or /usr/lib/systemd/systemd, continue.
  2. Install the provider package with sudo apt install systemd.
  3. Verify command -v systemctl and systemctl --version.
  4. If the command still is not found but the file exists, apply the PATH fix.

Any system where the file exists but the command is not found

  1. Confirm the location with ls -l /usr/bin/systemctl or find / -name systemctl.
  2. Temporarily export the containing directory, such as export PATH=$PATH:/usr/bin.
  3. Place the export in ~/.bashrc or ~/.profile if the change must survive new sessions.
  4. Recheck the command from the shell, script, or service account that originally failed.

Alpine host

  1. Confirm that PID 1 is not systemd.
  2. Use rc-service <name> start for an immediate start.
  3. Use rc-update for boot-time service configuration.

Container

  1. Run the PID and path diagnostics inside the container.
  2. If the application or a supervisor is PID 1, do not install systemd just to obtain systemctl.
  3. Use the container’s supervisor, or restart/recreate the container from the outside.

WSL 2 distribution

  1. Put [boot] and systemd=true in /etc/wsl.conf.
  2. Run wsl.exe --shutdown from PowerShell.
  3. Reopen the distribution and verify PID 1.

Final checks before declaring it fixed

  • command -v systemctl returns the executable you intend to use.
  • type -a systemctl does 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-update for OpenRC, or service for SysVinit.
  • In WSL, the distribution is WSL 2, /etc/wsl.conf is spelled correctly, and the instance was restarted with wsl.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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.