This upgrade seems to have been done from Ubuntu 22.04 (jammy) to 24.04
(noble), and not noble to resolute, due to the versions involved:

spamassassin:amd64 (3.4.6-1ubuntu0.22.04.1, 4.0.0-8ubuntu5)

The former is in jammy, and the latter in noble:
 spamassassin | 3.4.6-1ubuntu0.22.04.1 | jammy-updates   | source
 spamassassin | 4.0.0-8ubuntu5         | noble           | source

Confirmed by the terminal log:
Настраивается пакет spamassassin (4.0.0-8ubuntu5) …

The actual error is related to gpg and permissions on its home
directory:

gpg: WARNING: unsafe ownership on homedir '/var/lib/spamassassin/sa-update-keys'
gpg: failed to create temporary file 
'/var/lib/spamassassin/sa-update-keys/.#lk0x000055b110508220.email.lezh.ru.64564':
 Permission denied
gpg: keyblock resource '/var/lib/spamassassin/sa-update-keys/pubring.kbx': 
Permission denied
gpg: no writable keyring found: Not found
gpg: error reading '/usr/share/spamassassin/GPG.KEY': General error
gpg: import from '/usr/share/spamassassin/GPG.KEY' failed: General error
gpg: process '/usr/bin/gpg --homedir='/var/lib/spamassassin/sa-update-keys' 
--batch --no-tty --status-fd=1 -q --logger-fd=1 --import' finished: exit 2

/var/lib/spamassassin and its subdirectories are owned by debian-
spamd:debian-spamd in a default installation:

root@j2n-spamassassin:~# l /var/lib/spamassassin/
total 0
drwxr-xr-x 1 debian-spamd debian-spamd  70 Jun 29 13:44 .
drwxr-xr-x 1 root         root         502 Jun 29 13:44 ..
drwx------ 1 debian-spamd debian-spamd  32 Jun 29 13:44 .spamassassin
drwxr-xr-x 1 debian-spamd debian-spamd  10 Jun 29 13:44 compiled
drwx------ 1 debian-spamd debian-spamd 226 Jun 29 13:44 sa-update-keys


The postinst script does try to cope with changed ownership, including 
overrides:

    OWNER=$(stat -c '%U' /var/lib/spamassassin)
    GROUP=$(stat -c '%G' /var/lib/spamassassin)
...
    # Lets debian-spamd claim ownership of spamassassin updates on upgrades,
    # unless the user has overridden.
    if ! dpkg-statoverride --list /var/lib/spamassassin/* >/dev/null && \
        [ "$OWNER:$GROUP" != "debian-spamd:debian-spamd" ]; then
        chown debian-spamd:debian-spamd /var/lib/spamassassin
        OWNER=debian-spamd
        GROUP=debian-spamd
    fi
...
        runuser -u "$OWNER" --group "$GROUP" -- \
        /usr/bin/sa-update \
            --gpghomedir /var/lib/spamassassin/sa-update-keys \
            --import /usr/share/spamassassin/GPG.KEY


I installed spamassassin on jammy, and performed a do-release-upgrade to noble, 
and the upgrade went smoothly. In the end, the ownership of 
/var/lib/spamassassin/** remained the same, and there were no postinstall 
errors.

Lezhenkin Evgeni, could you perhaps provide the following:
- did you have any customizations to ownership of /var/lib/spamassassin or 
subdirectories?
- can you also provide the release upgrade logs, from /var/log/dist-upgrade?
- this error is also weird: "gpg: import from '/usr/share/spamassassin/GPG.KEY' 
failed: General error". Do you have some sort of security in place that would 
prevent reading that file? I didn't spot anything in your dmesg output, though.


** Changed in: spamassassin (Ubuntu)
       Status: New => Incomplete

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

Title:
  package spamassassin 4.0.0-8ubuntu5 failed to install/upgrade:
  подпроцесс из пакета spamassassin установлен сценарий post-
  installation возвратил код ошибки 2

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to