I have encountered this occasionally over several years, and have just
had it happen on an install of Ubuntu 16.10 (clean install of 16.10, not
upgraded from an earlier version).

The postinst script for systemd does

   addgroup --system systemd-journal

This gives the error 
   addgroup: The group `systemd-journal' already exists and is not a system 
group. Exiting.
and package install fails.

$ dpkg -l systemd
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
iF  systemd        231-9ubuntu3 amd64        system and service manager


The problem is that addgroup will return 0 for --system if the group
exists and the gid is between FIRST_SYSTEM_GID and LAST_SYSTEM_GID, but
these are not set in the default /etc/adduser.conf file, so 'addgroup
--system systemd-journal' returns 1 instead:

# addgroup --system systemd-journal
addgroup: The group `systemd-journal' already exists and is not a system group. 
Exiting.
# echo $?
1

# echo 'FIRST_SYSTEM_GID=50' >> /etc/adduser.conf
# echo 'LAST_SYSTEM_GID=300' >> /etc/adduser.conf

# addgroup --system systemd-journal
addgroup: The group `systemd-journal' already exists as a system group. Exiting.
# echo $?
0


The postinst script should be modified to either test if the group already 
exists (and not rely on addgroup to do it silently), or do  "addgroup --system 
systemd-journal || true"  to ignore errors from addgroup.


** Changed in: systemd (Ubuntu)
       Status: Expired => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1570310

Title:
  package systemd 229-4ubuntu4 failed to install/upgrade: subprocess
  installed pre-removal script returned error exit status 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1570310/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to