In this document, I will explain how to upgrade the default systemd version from 237 to 242.
# Install required dependencies
sudo apt install build-essential devscripts python3-pip cmake libssl-dev libpcre2-dev
sudo apt purge meson -yq
sudo apt install python3-pip -yq
sudo pip3 install meson
# Upgrade Meson version
sudo -H pip3 install --target=/usr/bin --upgrade meson
# Install new user Meson version
pip3 install --user meson
# Reboot to complete changes
sudo reboot# Patch sources file
sudo sed -e 's/# deb-src/deb-src/' -i /etc/apt/sources.list
# Update package cache
sudo apt update --fix-missing -ysudo apt build-dep systemdwget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/systemd/242-7ubuntu3.11/systemd_242.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/systemd/242-7ubuntu3.11/systemd_242-7ubuntu3.11.debian.tar.xz
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/systemd/242-7ubuntu3.11/systemd_242-7ubuntu3.11.dscIt won't work with later versions
# Move to home
cd $HOME
# Uncompress orig archive
tar xvzf systemd_242.orig.tar.gz
# Move to decompressed folder
cd systemd-242
# Uncompress debian files
tar xvJf ../systemd_242-7ubuntu3.11.debian.tar.xzThis will also generate debian packages to install in next step.
dpkg-buildpackage -us -uc -dThis step is pretty long so be patient if you don't have a lot of CPU cores.
The argument
-dis required to bypass the requested Meson version.
Now we will install the new compiled systemd version.
# Move back to home
cd $HOME
# List generated debian packages
ll | grep deb
# Create dedicated folder for debian packages
mkdir -v systemd-242-debs
# Move all created packages
mv -v *.*deb systemd-242-debs/
# Move to debian packages folder
cd systemd-242-debs
# Install generated packages
sudo dpkg --auto-deconfigure -i *.deb
# Reboot to apply changes
sudo rebootYou can safely ignore this error:
Errors were encountered while processing: systemd-coredump_242-7ubuntu3.11_amd64.deb
systemd --versionIt should return something similar:
systemd 242 (242)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
- https://wiki.archlinux.org/index.php/systemd
- https://askubuntu.com/questions/627174/how-would-i-upgrade-systemd
- https://www.freedesktop.org/wiki/Software/systemd/
- https://launchpad.net/ubuntu/+source/systemd
- https://launchpad.net/ubuntu/+source/systemd/242-7ubuntu3.11
- https://github.com/systemd/systemd
- https://askubuntu.com/questions/1212424/update-meson-on-ubuntu-18-04-4-lts-force-update
Cross compiler
sudo qemu-debootstrap --arch armhf buster /mnt/data/armhf http://deb.debian.org/debian/
sudo chroot /mnt/data/armhf
https://stackoverflow.com/questions/58348139/how-to-install-dependencies-for-a-project-that-is-being-cross-compiled-on-an-x86