First, you should know how to check systemd version on Linux. The system version command is:
1 |
systemctl --version |
You will see the output is “systemd 219″ on CentOS 7. This version is too low for many software that depend on systemd. Unless you use an unofficial repo, you cannot upgrade systemd to higher version on CentOS with yum. You can build systemd from source code yourself. But don’t try to build the latest systemd versions such as systemd v252 orĀ systemd v251 on CentOS 7 as they need higher kernel version of Linux(>=3.15) which is not shipped with CentOS 7. To check the kernel version in centos, use the following command:
1 |
uname -r |
The kernel version of centos 7 is 3.10.0. If you try to build the latest version of systemd, you will get the errors like:
../src/libsystemd/sd-netlink/netlink-message-nfnl.c:21:23: error: ‘NFPROTO_NETDEV’ undeclared (first use in this function)
../src/shared/loop-util.c:334:41: error: ‘LO_FLAGS_DIRECT_IO’ undeclared (first use in this function)
I’ve successfully built and installed systemd V247 using the following commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
yum groupinstall "Development Tools" yum install libcap-devel yum install gperf yum install glib2-devel yum install python3-pip pip3 install meson==0.59.4 pip3 install ninja pip3 install jinja2 wget https://github.com/systemd/systemd/archive/v247.tar.gz tar -zxvf v247.tar.gz && cd systemd-247 ./configure make make install |
The commands mainly come (but different) from this post and this post. Note that you must use an earlier version of meson such as 0.59.4. Otherwise, you may get this error:
1 |
meson.build:38:3: ERROR: Object <[BooleanHolder] holds [bool]: False> of type bool does not support the `+` operator. |