systemd-sysusers command not found

In this troubleshooting guide we learn how to fix systemd-sysusers command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

systemd-sysusers: command not found

or when using sudo you get the following error message

sudo: systemd-sysusers: command not found

Solutions to systemd-sysusers: command not found

How To Fix systemd-sysusers: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu systemd-sysusers is provided by opensysusers package.

opensysusers is:

Opensysusers uses the files from sysusers.d directory to create system users and groups and to add users to groups, at package installation or boot time. This tool may be used to allocate system users and groups only, it is not useful for creating non-system (i.e. regular, “human”) users and groups, as it accesses /etc/passwd and /etc/group directly, bypassing any more complex user databases, for example any database involving NIS or LDAP.

Opensysusers is an alternative implementation of systemd-sysusers that may work on systems with or without systemd installed.

To fix this problem, we can install more using the command below.

sudo apt-get -y install opensysusers

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install opensysusers.

sudo apt -y install opensysusers

Or if you have aptitude installed you can use the following command.

sudo aptitude install opensysusers

Summary

In this tutorial we learn how to fix systemd-sysusers command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.