Cannot purge biond glance-common (train)

Asked by Eliezer Croitoru on 2020-07-31

I am trying to run:
apt purge glance-common glance-api glance
And I am getting this error:

Do you want to continue? [Y/n] y
Processing triggers for systemd (237-3ubuntu10.41) ...
Processing triggers for ureadahead (0.100.0-21) ...
(Reading database ... 84494 files and directories currently installed.)
Purging configuration files for glance-common (2:18.0.1-0ubuntu1~cloud0) ...
dpkg: error processing package glance-common (--purge):
 installed glance-common package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 glance-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried to reinstall remove and couple other "solutions" around but I just can't "purge it", I can only remove it.

Should I try something specific?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2020-07-31
Last reply:
2020-07-31

Try:

sudo apt-get --purge remove glance-common glance-api glance

Does that work?

Manfred Hampl (m-hampl) said : #2

For diagnostic purposes, what is the output of the commands

uname -a
lsb_release -crid
apt-cache policy glance-common glance-api glance
cat -n /var/lib/dpkg/info/glance-common.postrm
getent passwd glance
getent group glance

Manfred Hampl (m-hampl) said : #3

I assume the user (or group) glance is not marked as "system" user (or group) which makes the postremove script fail at the command "deluser --system" or delgroup --system"

Eliezer Croitoru (eliezer) said : #4

"I assume the user (or group) glance is not marked as "system" user (or group) which makes the postremove script fail at the command "deluser --system" or delgroup --system" "

@m-hampl This is exactly what I was thinking.

I managed to remove the package and reinstall it but something is still broken.

I have installed the whole server from scratch to see if it's something the can be reproduced on a clean system, and it is reproducible.

output of the commands you gave me:
+ uname -a
Linux controller-1 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
+ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
+ apt-cache policy glance-common glance-api glance
glance-common:
  Installed: (none)
  Candidate: 2:19.0.3-0ubuntu1~cloud0
  Version table:
     2:19.0.3-0ubuntu1~cloud0 500
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu bionic-updates/train/main amd64 Packages
        100 /var/lib/dpkg/status
     2:16.0.1-0ubuntu1.1 500
        500 http://il.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     2:16.0.0-0ubuntu1 500
        500 http://il.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
glance-api:
  Installed: (none)
  Candidate: 2:19.0.3-0ubuntu1~cloud0
  Version table:
     2:19.0.3-0ubuntu1~cloud0 500
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu bionic-updates/train/main amd64 Packages
     2:16.0.1-0ubuntu1.1 500
        500 http://il.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     2:16.0.0-0ubuntu1 500
        500 http://il.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
glance:
  Installed: (none)
  Candidate: 2:19.0.3-0ubuntu1~cloud0
  Version table:
     2:19.0.3-0ubuntu1~cloud0 500
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu bionic-updates/train/main amd64 Packages
     2:16.0.1-0ubuntu1.1 500
        500 http://il.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     2:16.0.0-0ubuntu1 500
        500 http://il.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
+ cat -n /var/lib/dpkg/info/glance-common.postrm
     1 #!/bin/sh
     2
     3 set -e
     4
     5 case $1 in
     6 purge)
     7 if (which deluser && getent passwd glance) > /dev/null 2>&1; then
     8 deluser --system --quiet --backup-to /var/lib glance
     9 fi
    10 if (which delgroup && getent group glance) > /dev/null 2>&1; then
    11 delgroup --system --quiet glance
    12 fi
    13 ;;
    14 esac
    15
    16
+ getent passwd glance
glance:x:64062:64062::/var/lib/glance:/bin/false
+ getent group glance
glance:x:64062:
+ set +x

Eliezer Croitoru (eliezer) said : #5

To resolve the issue "manually" I tried to run:
deluser --quiet --backup-to /var/lib glance
delgroup --quiet glance

then:
apt purge glance-common glance glance-api

and after this everything runs great.

So the issue is the "--system" in the postrm function/file.

I suggest you report a bug. The uninstall file seems faulty. Hopefully a new one will be made soon to make this smoother

Can you help with this problem?

Provide an answer of your own, or ask Eliezer Croitoru for more information if necessary.

To post a message you must log in.