24

How can I find the systemd version that came as part of my linux (raspbian) installation?

On running lsb_release -a, I get the linux (raspbian) version information as follows

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch

jww
  • 11,918
  • 44
  • 119
  • 208
tanay
  • 371
  • 1
  • 2
  • 3
  • Downvoted because no effort was shown to answer a basic question which has basically the same answer for most any software package. The answer is even right in "man systemd" if you search in there for "version". – Mark Stosberg Jan 04 '18 at 15:18

1 Answers1

37

Ask it:

$ /sbin/init --version
systemd 123

$ systemctl --version
systemd 123

You can also ask the package manager:

$ dpkg -l systemd
||/ Name              Version       Architecture  Description
+++-=================-=============-=============-========================================
ii  systemd           123-1         amd64         system and service manager

If you think the files might have been upgraded since, you can ask the running process:

$ busctl --system get-property org.freedesktop.systemd1 \
                               /org/freedesktop/systemd1 \
                               org.freedesktop.systemd1.Manager \
                               Version
s "123"
u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • 4
    On Raspbian Stretch Lite, I get `/sbin/init: unrecognized option '--version'`. Even though the man page says this is a valid option. – Elliott B Jun 25 '18 at 03:13
  • 3
    On many systems, `/sbin/init` is a symbolic link to `../lib/systemd/systemd` and the `--version` option is recognized only if the binary is called directly like `/lib/systemd/systemd --version` – Robin A. Meade Apr 26 '20 at 00:15