I have verified the fix using systemd from jammy-proposed. Since ubuntu- release-upgrader was already accepted, I did not need to make any changes to the upgrade step.
First, I installed systemd from jammy-proposed: nr@six:~$ lxc launch ubuntu:jammy j Launching j nr@six:~$ lxc exec j bash root@j:~# cat > /etc/apt/sources.list.d/proposed.list << EOF deb http://archive.ubuntu.com/ubuntu/ jammy-proposed main universe EOF root@j:~# cat <<EOF >/etc/apt/preferences.d/proposed-updates Package: * Pin: release a=jammy-proposed Pin-Priority: 400 EOF root@j:~# apt update && apt install -y -t jammy-proposed systemd Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB] Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB] Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2110 kB] Get:6 http://archive.ubuntu.com/ubuntu jammy-proposed InRelease [279 kB] Get:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB] Get:8 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [329 kB] Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2899 kB] Get:10 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [509 kB] Get:11 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [965 kB] Get:12 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [207 kB] Get:13 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [19.5 kB] Get:14 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [37.6 kB] Get:15 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [8260 B] Get:16 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [224 B] Get:17 http://archive.ubuntu.com/ubuntu jammy/universe Translation-en [5652 kB] Get:18 http://archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB] Get:19 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB] Get:20 http://archive.ubuntu.com/ubuntu jammy/multiverse Translation-en [112 kB] Get:21 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8372 B] Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2352 kB] Get:23 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [392 kB] Get:24 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [3008 kB] Get:25 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [528 kB] Get:26 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1192 kB] Get:27 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [293 kB] Get:28 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [26.4 kB] Get:29 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [44.5 kB] Get:30 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [11.5 kB] Get:31 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [440 B] Get:32 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [67.7 kB] Get:33 http://archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [11.1 kB] Get:34 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B] Get:35 http://archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B] Get:36 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [30.0 kB] Get:37 http://archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.6 kB] Get:38 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [672 B] Get:39 http://archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B] Get:40 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages [362 kB] Get:41 http://archive.ubuntu.com/ubuntu jammy-proposed/main Translation-en [75.0 kB] Get:42 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 c-n-f Metadata [1740 B] Get:43 http://archive.ubuntu.com/ubuntu jammy-proposed/universe amd64 Packages [85.1 kB] Get:44 http://archive.ubuntu.com/ubuntu jammy-proposed/universe Translation-en [30.0 kB] Get:45 http://archive.ubuntu.com/ubuntu jammy-proposed/universe amd64 c-n-f Metadata [1344 B] Fetched 36.6 MB in 6s (6081 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libnss-systemd libpam-systemd libsystemd0 systemd-sysv systemd-timesyncd Suggested packages: systemd-container libtss2-rc0 The following packages will be upgraded: libnss-systemd libpam-systemd libsystemd0 systemd systemd-sysv systemd-timesyncd 6 upgraded, 0 newly installed, 0 to remove and 16 not upgraded. Need to get 5275 kB of archives. After this operation, 0 B of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 libnss-systemd amd64 249.11-0ubuntu3.15 [133 kB] Get:2 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 systemd-timesyncd amd64 249.11-0ubuntu3.15 [31.2 kB] Get:3 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 systemd-sysv amd64 249.11-0ubuntu3.15 [10.5 kB] Get:4 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 libpam-systemd amd64 249.11-0ubuntu3.15 [203 kB] Get:5 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 systemd amd64 249.11-0ubuntu3.15 [4581 kB] Get:6 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 libsystemd0 amd64 249.11-0ubuntu3.15 [317 kB] Fetched 5275 kB in 0s (11.9 MB/s) (Reading database ... 34046 files and directories currently installed.) Preparing to unpack .../0-libnss-systemd_249.11-0ubuntu3.15_amd64.deb ... Unpacking libnss-systemd:amd64 (249.11-0ubuntu3.15) over (249.11-0ubuntu3.12) ... Preparing to unpack .../1-systemd-timesyncd_249.11-0ubuntu3.15_amd64.deb ... Unpacking systemd-timesyncd (249.11-0ubuntu3.15) over (249.11-0ubuntu3.12) ... Preparing to unpack .../2-systemd-sysv_249.11-0ubuntu3.15_amd64.deb ... Unpacking systemd-sysv (249.11-0ubuntu3.15) over (249.11-0ubuntu3.12) ... Preparing to unpack .../3-libpam-systemd_249.11-0ubuntu3.15_amd64.deb ... Unpacking libpam-systemd:amd64 (249.11-0ubuntu3.15) over (249.11-0ubuntu3.12) ... Preparing to unpack .../4-systemd_249.11-0ubuntu3.15_amd64.deb ... Unpacking systemd (249.11-0ubuntu3.15) over (249.11-0ubuntu3.12) ... Preparing to unpack .../5-libsystemd0_249.11-0ubuntu3.15_amd64.deb ... Unpacking libsystemd0:amd64 (249.11-0ubuntu3.15) over (249.11-0ubuntu3.12) ... Setting up libsystemd0:amd64 (249.11-0ubuntu3.15) ... Setting up systemd (249.11-0ubuntu3.15) ... Setting up systemd-timesyncd (249.11-0ubuntu3.15) ... Setting up systemd-sysv (249.11-0ubuntu3.15) ... Setting up libnss-systemd:amd64 (249.11-0ubuntu3.15) ... Setting up libpam-systemd:amd64 (249.11-0ubuntu3.15) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for dbus (1.12.20-2ubuntu4.1) ... Processing triggers for libc-bin (2.35-0ubuntu3.9) ... Scanning processes... Scanning candidates... Restarting services... systemctl restart packagekit.service polkit.service rsyslog.service ssh.service Service restarts being deferred: /etc/needrestart/restart.d/dbus.service systemctl restart networkd-dispatcher.service systemctl restart systemd-logind.service systemctl restart unattended-upgrades.service No containers need to be restarted. No user sessions are running outdated binaries. No VM guests are running outdated hypervisor (qemu) binaries on this host. root@j:~# apt policy systemd systemd: Installed: 249.11-0ubuntu3.15 Candidate: 249.11-0ubuntu3.15 Version table: *** 249.11-0ubuntu3.15 400 400 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages 100 /var/lib/dpkg/status 249.11-0ubuntu3.12 500 500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages 249.11-0ubuntu3.7 500 500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages 249.11-0ubuntu3 500 500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages Then, disabled systemd-resolved and setup dnsmasq: root@j:~# systemctl disable --now systemd-resolved Removed /etc/systemd/system/dbus-org.freedesktop.resolve1.service. Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service. root@j:~# sed -i 's/nameserver.*/nameserver 1.1.1.1/g' /etc/resolv.conf root@j:~# apt install dnsmasq -y Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: dns-root-data dnsmasq-base Suggested packages: resolvconf The following NEW packages will be installed: dns-root-data dnsmasq dnsmasq-base 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 400 kB of archives. After this operation, 1027 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 dns-root-data all 2024071801~ubuntu0.22.04.1 [6132 B] Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 dnsmasq-base amd64 2.90-0ubuntu0.22.04.1 [374 kB] Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 dnsmasq all 2.90-0ubuntu0.22.04.1 [19.7 kB] Fetched 400 kB in 1s (466 kB/s) Selecting previously unselected package dns-root-data. (Reading database ... 34046 files and directories currently installed.) Preparing to unpack .../dns-root-data_2024071801~ubuntu0.22.04.1_all.deb ... Unpacking dns-root-data (2024071801~ubuntu0.22.04.1) ... Selecting previously unselected package dnsmasq-base. Preparing to unpack .../dnsmasq-base_2.90-0ubuntu0.22.04.1_amd64.deb ... Unpacking dnsmasq-base (2.90-0ubuntu0.22.04.1) ... Selecting previously unselected package dnsmasq. Preparing to unpack .../dnsmasq_2.90-0ubuntu0.22.04.1_all.deb ... Unpacking dnsmasq (2.90-0ubuntu0.22.04.1) ... Setting up dnsmasq-base (2.90-0ubuntu0.22.04.1) ... Setting up dns-root-data (2024071801~ubuntu0.22.04.1) ... Setting up dnsmasq (2.90-0ubuntu0.22.04.1) ... Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /lib/systemd/system/dnsmasq.service. Processing triggers for man-db (2.10.2-1) ... Processing triggers for dbus (1.12.20-2ubuntu4.1) ... Scanning processes... Scanning candidates... Restarting services... Service restarts being deferred: /etc/needrestart/restart.d/dbus.service systemctl restart networkd-dispatcher.service systemctl restart systemd-logind.service systemctl restart unattended-upgrades.service No containers need to be restarted. No user sessions are running outdated binaries. No VM guests are running outdated hypervisor (qemu) binaries on this host. root@j:~# systemctl status dnsmasq systemd-resolved ● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2025-02-28 17:01:44 UTC; 42s ago Process: 2247 ExecStartPre=/etc/init.d/dnsmasq checkconfig (code=exited, status=0/SUCCESS) Process: 2255 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS) Process: 2264 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS) Main PID: 2263 (dnsmasq) Tasks: 1 (limit: 18945) Memory: 684.0K CPU: 38ms CGroup: /system.slice/dnsmasq.service └─2263 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.d> Feb 28 17:01:44 j systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server... Feb 28 17:01:44 j dnsmasq[2263]: started, version 2.90 cachesize 150 Feb 28 17:01:44 j dnsmasq[2263]: DNS service limited to local subnets Feb 28 17:01:44 j dnsmasq[2263]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP > Feb 28 17:01:44 j dnsmasq[2263]: reading /etc/resolv.conf Feb 28 17:01:44 j dnsmasq[2263]: using nameserver 1.1.1.1#53 Feb 28 17:01:44 j dnsmasq[2263]: read /etc/hosts - 8 names Feb 28 17:01:44 j systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server. ○ systemd-resolved.service - Network Name Resolution Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:systemd-resolved.service(8) man:org.freedesktop.resolve1(5) https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients Feb 28 17:00:53 j systemd[1]: Stopped Network Name Resolution. Feb 28 17:00:53 j systemd[1]: Starting Network Name Resolution... Feb 28 17:00:53 j systemd-resolved[1804]: Positive Trust Anchors: Feb 28 17:00:53 j systemd-resolved[1804]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7> Feb 28 17:00:53 j systemd-resolved[1804]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172> Feb 28 17:00:53 j systemd-resolved[1804]: Using system hostname 'j'. Feb 28 17:00:53 j systemd[1]: Started Network Name Resolution. Feb 28 17:01:28 j systemd[1]: Stopping Network Name Resolution... Feb 28 17:01:28 j systemd[1]: systemd-resolved.service: Deactivated successfully. Feb 28 17:01:28 j systemd[1]: Stopped Network Name Resolution. Then I ran an upgrade: root@j:~# do-release-upgrade ...SNIP... Finally, after the upgrade: root@j:~# systemctl status dnsmasq systemd-resolved ● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; preset: enabled) Active: active (running) since Fri 2025-02-28 17:09:22 UTC; 2min 58s ago Main PID: 26340 (dnsmasq) Tasks: 1 (limit: 18945) Memory: 764.0K (peak: 2.7M) CPU: 31ms CGroup: /system.slice/dnsmasq.service └─26340 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsm> Feb 28 17:09:22 j systemd[1]: Starting dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server... Feb 28 17:09:22 j dnsmasq[26340]: started, version 2.90 cachesize 150 Feb 28 17:09:22 j dnsmasq[26340]: DNS service limited to local subnets Feb 28 17:09:22 j dnsmasq[26340]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP> Feb 28 17:09:22 j dnsmasq[26340]: read /etc/hosts - 8 names Feb 28 17:09:22 j resolvconf[26348]: Dropped protocol specifier '.dnsmasq' from 'lo.dnsmasq'. Using 'lo' (ifindex=1). Feb 28 17:09:22 j resolvconf[26348]: Failed to set DNS configuration: Unit dbus-org.freedesktop.resolve1.service not f> Feb 28 17:09:22 j systemd[1]: Started dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server. ○ systemd-resolved.service - Network Name Resolution Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; disabled; preset: enabled) Active: inactive (dead) Docs: man:systemd-resolved.service(8) man:org.freedesktop.resolve1(5) https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients Feb 28 17:00:53 j systemd[1]: Stopped Network Name Resolution. Feb 28 17:00:53 j systemd[1]: Starting Network Name Resolution... Feb 28 17:00:53 j systemd-resolved[1804]: Positive Trust Anchors: Feb 28 17:00:53 j systemd-resolved[1804]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7> Feb 28 17:00:53 j systemd-resolved[1804]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172> Feb 28 17:00:53 j systemd-resolved[1804]: Using system hostname 'j'. Feb 28 17:00:53 j systemd[1]: Started Network Name Resolution. Feb 28 17:01:28 j systemd[1]: Stopping Network Name Resolution... Feb 28 17:01:28 j systemd[1]: systemd-resolved.service: Deactivated successfully. Feb 28 17:01:28 j systemd[1]: Stopped Network Name Resolution. root@j:~# grep stub-resolver /var/log/dist-upgrade/main.log 2025-02-28 17:04:28,681 DEBUG systemd-resolved is not running, not disabling stub-resolver ** Tags removed: verification-needed-jammy ** Tags added: verification-done-jammy -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to dnsmasq in Ubuntu. https://bugs.launchpad.net/bugs/2078555 Title: Upgrading from 22.04 to 24.04.01 breaks dnsmasq Status in Ubuntu: Triaged Status in dnsmasq package in Ubuntu: Invalid Status in systemd package in Ubuntu: Invalid Status in ubuntu-release-upgrader package in Ubuntu: Invalid Status in The Jammy Jellyfish: New Status in dnsmasq source package in Jammy: Invalid Status in systemd source package in Jammy: Fix Committed Status in ubuntu-release-upgrader source package in Jammy: Invalid Status in The Noble Numbat: New Status in dnsmasq source package in Noble: Invalid Status in systemd source package in Noble: Won't Fix Status in ubuntu-release-upgrader source package in Noble: Fix Released Bug description: [Impact] During upgrades, systemd-resolved will be started and enabled, even if it was not previously. This is due to (a) the package split that made systemd-resolved its own package (during kinetic cycle, hence between jammy and noble), and (b) an ubuntu-release-upgrader quirk that (re)starts systemd-resolved out of stub mode during the upgrade to avoid DNS resolution failures during the upgrade. [Test Plan] The complete test plan requires the fixed version of systemd *and* ubuntu-release-upgrader. On a Jammy machine, install systemd from jammy-proposed: $ cat > /etc/apt/sources.list.d/proposed.list << EOF deb http://archive.ubuntu.com/ubuntu/ jammy-proposed main universe EOF $ cat <<EOF >/etc/apt/preferences.d/proposed-updates Package: * Pin: release a=jammy-proposed Pin-Priority: 400 EOF $ apt update && apt install -y -t jammy-proposed systemd $ apt policy systemd Then, disable systemd-resolved, and install dnsmasq: $ systemctl disable --now systemd-resolved $ sed -i 's/nameserver.*/nameserver 1.1.1.1/g' /etc/resolv.conf # Use any DNS server $ apt install dnsmasq -y $ systemctl status dnsmasq systemd-resolved At this point, dnsmasq should be running, and systemd-resolved should not. Now, we can run the upgrade: $ do-release-upgrade --proposed [...] The upgrade should complete normally. At the end, systemd-resolved should still be disabled/inactive, and dnsmasq should still be running: $ systemctl status dnsmasq systemd-resolved [Where problems could occur] systemd: The patch is adding a new systemd.prerm. Any issues here would be seen during package upgrades of systemd in/from Jammy. It is designed to only run during upgrades to Noble from Jammy, so the scope is limited there. If something did occur, it would be within the deb-systemd- helper script, which would not be fatal to the systemd.prerm script given the || true after the invocation. ubuntu-release-upgrader: The patch adds a call to systemctl is-active to check whether systemd- resolved is running. If this was broken, systemd-resolved might be started during the ugprade anyways. This would not lead to systemd- resolved being enabled, though. [Other information] For the complete upgrade experience to be fixed for affected users, both of these updates need to land. Hence, we should aim to release these at the same time. However, having one fix but not the other would not make the situation any worse. [Original Description] Was running Ubuntu 22.04 as home gateway/firewall with dnsmasq as dns/dhcp server. Previous upgrade from Ubuntu 20.04 to 22.04 had worked without issue. After the upgrade to 24.04.01, systemd-resovled was automatically enabled. The result was that after a reboot, dnsmasq failed to start, as systemd-resolved had already bound to the necessary port. This in turn meant that my entire home network lost connectivity as it was dependant on dnsmasq running to provide both correct dns and dhcp functionality. Ideally, during the upgrade process, a check should be made for if another dns/dhcp service is already enabled, and if so, not enable systemd-resolved. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+bug/2078555/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp