package libvirt-daemon-system 4.0.0-1ubuntu8.19 failed to install/upgrade: installed libvirt-daemon-system package post-removal script subprocess returned error exit status 128
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Invalid
|
Medium
|
Unassigned |
Bug Description
upgraded from 16.04? to 18.04 at end of upgrade I got libvirt-
I didn't change anything in the /etc/livirt/
now accuses me of doing! I logged in this time through Unity to get my old desktop back and that is when I got this system report.
I was getting a system error when I logged in after the upgrade but no error # or anything;
ProblemType: Package
DistroRelease: Ubuntu 18.04
Package: libvirt-
ProcVersionSign
Uname: Linux 4.15.0-162-generic i686
ApportVersion: 2.20.9-0ubuntu7.27
Architecture: i386
Date: Sun Nov 21 13:46:10 2021
ErrorMessage: installed libvirt-
InstallationDate: Installed on 2021-11-05 (18 days ago)
InstallationMedia: Ubuntu 16.04.5 LTS "Xenial Xerus" - Release i386 (20180731)
ProcCmdline: BOOT_IMAGE=
Python3Details: /usr/bin/python3.6, Python 3.6.9, python3-minimal, 3.6.7-1~18.04
PythonDetails: /usr/bin/python2.7, Python 2.7.17, python-minimal, 2.7.15~rc1-1
SourcePackage: libvirt
Title: package libvirt-
UpgradeStatus: Upgraded to bionic on 2021-11-21 (1 days ago)
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
mtime.conffile.
tags: | removed: server-todo |
Hi Patrick,
I had to smile about you feeling "accused to modify files", on one does so.
It is an automated detection of files not matching or being part of the installed archive, but those listed here are generated on installation - so I can confirm you did not do anything wrong in regard to those files. BTW newer versions (I think 21.04+) will handle them slightly differently and no more 'accuse' people.
But all of that isn't the actual problem, the issue that you faced was this:
``` daemon- system (4.0.0-1ubuntu8.19) ... daemon- system (--purge):
Removing libvirt-daemon dnsmasq configuration
Purging configuration files for libvirt-
/usr/sbin/delgroup: `libvirt-dnsmasq' still has `libvirtd' as their primary group!
/usr/sbin/delgroup: `libvirt-dnsmasq' still has `libvirt' as their primary group!
userdel: group libvirt-dnsmasq not removed because it is not the primary group of user libvirt-dnsmasq.
[1mdpkg:[0m error processing package libvirt-
```
I can't see why - as part of the upgrade - it tried to remove libvirt for you, the log isn't long enough to show that. But while removing it the user failed to be removed and that is the problem.
Back in 16.04 this was created as:
-- system \
-- ingroup libvirtd \
-- disabled- login \
-- disabled- password \ libvirt/ dnsmasq \
-- no-create- home \
libvirt- dnsmasq
if ! getent passwd libvirt-dnsmasq >/dev/null; then
adduser --quiet \
--quiet \
--home /var/lib/
-gecos "Libvirt Dnsmasq" \
fi
In 18.04 that changed and it indeed got its own group also named libvirt-dnsmasq (which is better as it has less permissions).
if ! getent group libvirt-dnsmasq >/dev/null; then
--system \
--ingroup libvirt-dnsmasq \
--disabled- login \
--disabled- password \
--home /var/lib/ libvirt/ dnsmasq \
--no- create- home \
--gecos "Libvirt Dnsmasq" \
libvirt- dnsmasq
addgroup --quiet --system libvirt-dnsmasq
fi
if ! getent passwd libvirt-dnsmasq >/dev/null; then
adduser --quiet \
fi
It seems you still have the user as it was created back in Xenial.
Then the removal/purging code of Bionic runs and fails.
All the removals I find are properly guarded by || true to not make it fail if anything is odd (like here by having the old user/group relation). So I wonder why this breaks for you:
if getent passwd libvirt-dnsmasq >/dev/null; then
deluser libvirt-dnsmasq >/dev/null || true
fi
# a running libvirt-dnsmasq will break these removals
# yet the lifecycle of the network is non-related to the pkg purge
# Therefore ignore errors on these removals, better leave a user than break
if getent group libvirt-dnsmasq >/dev/null; then
delgroup libvirt-dnsmasq --system 2>/dev/null >/dev/null || true
fi
if getent passwd libvirt-dnsmasq >/dev/null; then
deluser libvirt-dnsmasq --system 2>/dev/null >/dev/null || true
fi
I'm trying to recreate this ...