Thanks for filing this bug, Peter. The issue here is not related to /etc/resolv.conf being read-only (it is actually a RW file) [1]. The issue lies in the fact that it is always mounted in a running container by docker itself [2].
During a package installation process, dpkg performs backups of existing files through hard links. Hard links cannot be performed across mounts, hence, dpkg fails to install systemd-resolved when it tried to backup /etc/resolv.conf $ apt-file search /etc/resolv.conf ... systemd-resolved: /etc/resolv.conf Now, while I am unsure where this bug belongs, this should be a good place to start a discussion. For further context, this is the bug where systemd-resolved split and /etc/resolv.conf ownership were discussed [3]. [1] https://github.com/moby/moby/pull/5129/files [2] https://docs.docker.com/storage/#good-use-cases-for-bind-mounts [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939904 ** Bug watch added: Debian Bug tracker #939904 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939904 ** Also affects: dpkg (Ubuntu) Importance: Undecided Status: New ** Also affects: systemd (Ubuntu) Importance: Undecided Status: New ** Summary changed: - systemd-resolved in kinetic image tries to replace resolv.conf + systemd-resolved is not installable in Docker images -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu. https://bugs.launchpad.net/bugs/1988300 Title: systemd-resolved is not installable in Docker images Status in Ubuntu Docker Images: New Status in dpkg package in Ubuntu: New Status in systemd package in Ubuntu: New Bug description: Since 30 August (going by my daily CI builds, I do see the changelog entry for resolved is a few days older), I get this: Selecting previously unselected package systemd-resolved. Preparing to unpack .../321-systemd-resolved_251.4-1ubuntu1_amd64.deb ... Unpacking systemd-resolved (251.4-1ubuntu1) ... dpkg: error processing archive /tmp/apt-dpkg-install-NS2Yvi/321-systemd-resolved_251.4-1ubuntu1_amd64.deb (--unpack): unable to make backup link of './etc/resolv.conf' before installing new version: Invalid cross-device link The reason this fails is that Docker mounts resolv.conf, readonly, from the host system, so dpkg is not allowed to move/replace it. (To be clear, I do not need systemd-resolved in my container. "apt install devscripts" pulled it in, and debtree does not tell me why. "apt install --no-install-recommends devscripts" does not pull it in, and I'll likely adjust my builds [for PowerDNS] to do that because it's a good idea anyway). To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-docker-images/+bug/1988300/+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