« Back to Systemd: Frequently Asked Questions

How to see the systemd version?

How to see the systemd version?

Run systemctl with the '--version' option.

systemctl --version

Systemd has multiple ways to show its version, support for features, paths, and user information. Let’s have a look at the different methods and what information it shows.

Using systemctl

A quick way to check the systemd version and the features it supports is using systemctl with the --type option. The first line will show the version, the second includes what features are supported, which are typically compiled by a Linux distribution.

# systemctl --version
systemd 252 (252.31-1~deb12u1)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified

Looking to retrieve just the version number?

# systemctl --version | awk '{if($1=="systemd" && $2~"^[0-9]"){print $2}}' | head -n 1
252

The command above queries the version and shows it if the first column contains the word ‘systemd’ and the second column starts with a number. Only the first one line of output is returned, in case this output changes over time.

Stored in file: systemd.pc

Systemd also stores information in the file /usr/share/pkgconfig/systemd.pc . It includes:

  • Paths
  • User ID ranges
  • Systemd version
# cat /usr/share/pkgconfig/systemd.pc

#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# Names with prefixes are preferred, and the run-together names should be
# considered deprecated (though there is no plan to remove them). New names
# shall have underscores.

prefix=/usr
root_prefix=
rootprefix=${root_prefix}
sysconf_dir=/etc
sysconfdir=${sysconf_dir}

systemd_util_dir=${root_prefix}/lib/systemd
systemdutildir=${systemd_util_dir}

systemd_system_unit_dir=${rootprefix}/lib/systemd/system
systemdsystemunitdir=${systemd_system_unit_dir}

systemd_system_preset_dir=${rootprefix}/lib/systemd/system-preset
systemdsystempresetdir=${systemd_system_preset_dir}

systemd_user_unit_dir=${prefix}/lib/systemd/user
systemduserunitdir=${systemd_user_unit_dir}

systemd_user_preset_dir=${prefix}/lib/systemd/user-preset
systemduserpresetdir=${systemd_user_preset_dir}

systemd_system_conf_dir=${sysconfdir}/systemd/system
systemdsystemconfdir=${systemd_system_conf_dir}

systemd_user_conf_dir=${sysconfdir}/systemd/user
systemduserconfdir=${systemd_user_conf_dir}

systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemd_system_unit_dir}:/usr/lib/systemd/system:/lib/systemd/system
systemdsystemunitpath=${systemd_system_unit_path}

systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemd_user_unit_dir}:/usr/lib/systemd/user:/usr/share/systemd/user
systemduserunitpath=${systemd_user_unit_path}

systemd_system_generator_dir=${root_prefix}/lib/systemd/system-generators
systemdsystemgeneratordir=${systemd_system_generator_dir}

systemd_user_generator_dir=${prefix}/lib/systemd/user-generators
systemdusergeneratordir=${systemd_user_generator_dir}

systemd_system_generator_path=/run/systemd/system-generators:/etc/systemd/system-generators:/usr/local/lib/systemd/system-generators:${systemd_system_generator_dir}
systemdsystemgeneratorpath=${systemd_system_generator_path}

systemd_user_generator_path=/run/systemd/user-generators:/etc/systemd/user-generators:/usr/local/lib/systemd/user-generators:${systemd_user_generator_dir}
systemdusergeneratorpath=${systemd_user_generator_path}

systemd_sleep_dir=${root_prefix}/lib/systemd/system-sleep
systemdsleepdir=${systemd_sleep_dir}

systemd_shutdown_dir=${root_prefix}/lib/systemd/system-shutdown
systemdshutdowndir=${systemd_shutdown_dir}

tmpfiles_dir=${prefix}/lib/tmpfiles.d
tmpfilesdir=${tmpfiles_dir}

user_tmpfiles_dir=${prefix}/share/user-tmpfiles.d

sysusers_dir=${prefix}/lib/sysusers.d
sysusersdir=${sysusers_dir}

sysctl_dir=${prefix}/lib/sysctl.d
sysctldir=${sysctl_dir}

binfmt_dir=${prefix}/lib/binfmt.d
binfmtdir=${binfmt_dir}

modules_load_dir=${prefix}/lib/modules-load.d
modulesloaddir=${modules_load_dir}

catalog_dir=${prefix}/lib/systemd/catalog
catalogdir=${catalog_dir}

system_uid_max=999
systemuidmax=${system_uid_max}
system_gid_max=999
systemgidmax=${system_gid_max}

dynamic_uid_min=61184
dynamicuidmin=${dynamic_uid_min}
dynamic_uid_max=65519
dynamicuidmax=${dynamic_uid_max}

container_uid_base_min=524288
containeruidbasemin=${container_uid_base_min}
container_uid_base_max=1878982656
containeruidbasemax=${container_uid_base_max}

Name: systemd
Description: systemd System and Service Manager
URL: https://systemd.io/
Version: 252

Using D-Bus

Another option is using D-Bus and make a query on the message bus to retrieve information about systemd. This can be done using the busctl command.

#busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Version
s "252.31-1~deb12u1"

To query other properties, use the introspect command on the related message bus.

busctl introspect org.freedesktop.systemd1 /org/freedesktop/systemd1

It will show all methods, properties, and signals for the relevant nodes.

Relevant commands in this article

Like to learn more about the commands that were used in this article? Have a look, for some there is also a cheat sheet available.

Other questions related to Systemd

Related articles

Like to learn more? Here is a list of articles within the same category or having similar tags.

Feedback

Small picture of Michael Boelen

This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

Mastodon icon