package systemd-resolved 253.5-1ubuntu7 failed to install/upgrade: installed systemd-resolved package post-installation script subprocess returned error exit status 1 [cp: '/etc/resolv.conf' and '/run/systemd/resolve/stub-resolv.conf' are the same file]

Bug #2047975 reported by CloudRoot AB
46
This bug affects 6 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Confirmed
Undecided
Unassigned
Noble
Triaged
High
Nick Rosbrook

Bug Description

upgraded from 22.04 -> 24.04

ProblemType: Package
DistroRelease: Ubuntu 24.04
Package: systemd-resolved 253.5-1ubuntu7
ProcVersionSignature: Ubuntu 6.2.0-39.40~22.04.1-generic 6.2.16
Uname: Linux 6.2.0-39-generic x86_64
ApportVersion: 2.27.0-0ubuntu6
Architecture: amd64
CasperMD5CheckResult: pass
CloudArchitecture: x86_64
CloudID: none
CloudName: none
CloudPlatform: none
CloudSubPlatform: config
Date: Wed Jan 3 21:06:55 2024
ErrorMessage: installed systemd-resolved package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2023-02-27 (311 days ago)
InstallationMedia: Ubuntu-Server 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809)
Python3Details: /usr/bin/python3.11, Python 3.11.7, python3-minimal, 3.11.4-5
PythonDetails: N/A
RebootRequiredPkgs: Error: path contained symlinks.
RelatedPackageVersions:
 dpkg 1.22.1ubuntu5
 apt 2.7.6
SourcePackage: systemd
Title: package systemd-resolved 253.5-1ubuntu7 failed to install/upgrade: installed systemd-resolved package post-installation script subprocess returned error exit status 1
UpgradeStatus: Upgraded to noble on 2024-01-03 (0 days ago)
mtime.conffile..etc.systemd.resolved.conf: 2023-02-27T21:16:55.869158

Revision history for this message
CloudRoot AB (cloudrootab) wrote :
affects: ubuntu → systemd (Ubuntu)
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
summary: package systemd-resolved 253.5-1ubuntu7 failed to install/upgrade:
installed systemd-resolved package post-installation script subprocess
- returned error exit status 1
+ returned error exit status 1 [cp: '/etc/resolv.conf' and
+ '/run/systemd/resolve/stub-resolv.conf' are the same file]
tags: added: mantic
Revision history for this message
Nick Rosbrook (enr0n) wrote (last edit ):

I got some information from a user on a more recent duplicate (bug 2063533). The problem seems to be that some users, when disabling the stub-resolver, also create a symlink /etc/resolv.conf -> /run/systemd/resolve/resolv.conf. This is not actually necessary because systemd-resolved will make stub-resolv.conf a symlink to resolv.conf when DNSStubListener=no.

Hence, the command

cp "${DPKG_ROOT}/etc/resolv.conf" "${DPKG_ROOT}/run/systemd/resolve/stub-resolv.conf"

in systemd-resolved.postinst fails because the source and destination are *both* symlinks to /run/systemd/resolve/resolv.conf.

Changed in systemd (Ubuntu Noble):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Nick Rosbrook (enr0n)
tags: added: foundations-todo systemd-sru-next
Nick Rosbrook (enr0n)
tags: removed: foundations-todo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.