0

I upgraded from Ubuntu 17.04 to 17.10. I have encountered 2 problems:-

1. As it upgraded these were the error logs produced:

  • Could not install 'network-manager-openvpu' Subprocess installed post-installation script returned error exit status 1
  • Could not install 'geoclue-2.0' Subprocess installed post-installation script returned error exit status 1
  • The upgrade has aborted. Your system could be in an unusable state. A recovery will now run (dpkg --config -a)
  • Upgrade has completed but there were errors during the upgrade process

2. I cannot download anything from the shopping bag icon / software center:

  • Unable to install [put any software here] Error while installing package: Subprocess installed post-installation script returned error exit status 1

Annex

I did

sudo apt autoremove

then this

sudo apt install --fix-missing
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up gdm3 (3.26.1-3ubuntu3) ...
addgroup: No GID is available in the range 100-999 (FIRST_SYS_GID - LAST_SYS_GID).
addgroup: The group `gdm' was not created.
dpkg: error processing package gdm3 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up geoclue-2.0 (2.4.7-1ubuntu1) ...
addgroup: No GID is available in the range 100-999 (FIRST_SYS_GID - LAST_SYS_GID).
addgroup: The group `geoclue' was not created.
dpkg: error processing package geoclue-2.0 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of empathy:
 empathy depends on geoclue-2.0 (>= 2.0); however:
  Package geoclue-2.0 is not configured yet.

dpkg: error processing package empathy (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.
                            dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on gdm3; however:
  Package gdm3 is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports has already been reached
                                                                    Errors were encountered while processing:
 gdm3
 geoclue-2.0
 empathy
 ubuntu-desktop
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • That's not a log, that's the error summary, and it lacks enough information to help you. Please use a terminal and copy/paste the complete output of the command sudo apt install --fix-missing. Please use proper formatting for output (use the {} button when composing or editing) – user535733 Nov 23 '17 at 15:12
  • @user535733 Please see Annex in original post. Don't understand "Please use proper formatting for output (use the {} button when composing or editing)" – jam Nov 23 '17 at 17:41
  • Your real problem seems to be addgroup: No GID is available in the range 100-999. Look at your /etc/groups. Do you really have 899 groups in that range? No duplicates you can (carefully, using the correct command) remove? – user535733 Nov 23 '17 at 17:53
  • @jam to check how many groups your system has in the 100-999 range run getent group | egrep [1-9][0-9][0-9] | wc -l in a terminal. getent will list all groups. The egrep will print only lines containing 100-999. wc will count the lines. – J. Starnes Nov 23 '17 at 19:05
  • @J.Starnes sudo getent group | egrep [1-9][0-9][0-9] | wc -l says 905 – jam Nov 23 '17 at 23:31
0

Remove some unneeded groups

Step 1 - Full system backup

The commands in this answer can cause havoc with your system. Make a full system backup with your preferred method. Validate/test this backup. Secure your backups so that the following steps can not harm them.
For more information about backups see Ubuntu Community Wiki - BackupYourSystem. I would recommend Clonezilla for a one time full os and user data backup. But for on going backups I use Borg Backup.

Step 2 - Select groups and users to remove

Running getent group | egrep \:[1-9][0-9][0-9]\: will list groups in the 100-999 range. From this list take note of a minimum of 10 unwanted groups related to guest accounts. They should not have any users listed as part of the group, nor should they be programs that are currently installed. The following code block shows that fourth field contains users in that group. Of these few only sambashare has a user. Only the "guest-" groups are a problem.

saned:x:122:
uuidd:x:123:
sambashare:x:124:jon
ssh:x:125:
geoclue:x:126:
guest-262uVu:x:127:
guest-qAD7pX:x:128:
guest-H1HJgy:x:129:
guest-fbfgab:x:130:
guest-LdeNZx:x:131:
guest-jIHtqC:x:132:
guest-w7GINW:x:133:

Step 3 - Remove unwanted groups

In the following commands replace <NEWGID> with a group to hold any residual files. You could either use an existing group or a new group. Also replace <OLDGID> with a group to be deleted. Run the commands once for each group to be removed. If you don't want any of the files from the old groups run the potentially very harmful command find / -group <OLDGID> -exec rm {} \;. If you don't care who may end up owning the deleted groups files you could just run delgroup --only-if-empty <OLDGID>.

find / -group <OLDGID> -exec rm {} \;
find / -group <OLDGID> -exec chgrp -h <NEWGID> {} \;
delgroup --only-if-empty <OLDGID>
# example using random groups
find / -group 200 -exec chgrp -h 2000 {} \;
delgroup --only-if-empty 200

Step 4 - Clean up

Run sudo dpkg --configure -a to finish configuring unpacked packages.

A bash script covering steps 2-4. Open a text editor, copy and past the following code block. Save the file as guest.sh. In a terminal navigate to where guest.sh was saved. run chmod +x guest.sh, to make the file executable. Then run ./guest.sh.

#!/bin/bash
TEMP=$(mktemp --tmpdir)

getent group | grep guest- | cut --delimiter=: -f 3 > "$TEMP"

NGID=$(head -n1 "$TEMP")
GIDS=$(grep -v "$NGID" "$TEMP" | tr '\n' ' ')

for i in $GIDS
    do
        find / -group "$i" -exec chgrp -h "$NGID" {} \;
        delgroup --only-if-empty "$i"
    done
rm "$TEMP"
sudo dpkg --configure -a
  • Thanks this is superb. Please tell me about replace <NEWGID> with a group to hold any residual files - should this be a new group or existing group. What command should I use if I don't want a group to hold any residual files - could I use only delgroup --only-if-empty <OLDGID>? – jam Nov 24 '17 at 18:00
  • Make a full system backup with your preferred method. Validate/test this backup. Secure your backups so that the following steps can not harm them. == What do you suggest if I am novice? Should I also use manual USB if backup file cannot be located? – jam Nov 24 '17 at 18:07
  • What does this mean find / -group 200 -exec chgrp -h 2000 {} \; delgroup --only-if-empty 200? – jam Nov 24 '17 at 22:51
  • The first line is an example of using find files owned by gid 200 in the path / then for every file found execute chgrp. chgrp changes the file to be owned by gid 2000. The second line runs delgrop to delete the 200 group but only if it has no users in it. The groups used in the above commands were chosen at random just to be used as an example. – J. Starnes Nov 25 '17 at 5:33
  • /etc/groups file link – jam Nov 29 '17 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.