Apt upgrade failed on linux-image

Hi,

I just ran apt update and apt upgrade and upgrading the linux-image package failed with the following error:

Fetched 555 MB in 3min 13s (2,875 kB/s)                                                                                                                        
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 207348 files and directories currently installed.)
Preparing to unpack .../linux-image-6.12.25-mnt-reform-arm64_6.12.25-1+reform20250503T111130Z_arm64.deb ...
Usage: /usr/bin/linux-run-hooks {preinst|postinst|prerm|postrm} MAINT-PARAMS VERSION IMAGE-PATH
       /usr/bin/linux-run-hooks headers_postinst MAINT-PARAMS VERSION

This command is intended to be called from the maintainer scripts of
Linux kernel packages.  It executes hooks installed in the appropriate
subdirectories of /etc/kernel and /usr/share/kernel.

The MAINT-PARAMS must be the parameters received by the maintainer
script, joined together with spaces.

The VERSION argument must be the kernel version string as shown by
'uname -r' and used in filenames.

The IMAGE-PATH argument must be the absolute filename of the kernel
image.
dpkg: error processing archive /var/cache/apt/archives/linux-image-6.12.25-mnt-reform-arm64_6.12.25-1+reform20250503T111130Z_arm64.deb (--unpack):
 new linux-image-6.12.25-mnt-reform-arm64 package pre-installation script subprocess returned error exit status 2
Usage: /usr/bin/linux-run-hooks {preinst|postinst|prerm|postrm} MAINT-PARAMS VERSION IMAGE-PATH
       /usr/bin/linux-run-hooks headers_postinst MAINT-PARAMS VERSION

This command is intended to be called from the maintainer scripts of
Linux kernel packages.  It executes hooks installed in the appropriate
subdirectories of /etc/kernel and /usr/share/kernel.

The MAINT-PARAMS must be the parameters received by the maintainer
script, joined together with spaces.

The VERSION argument must be the kernel version string as shown by
'uname -r' and used in filenames.

The IMAGE-PATH argument must be the absolute filename of the kernel
image.
dpkg: error while cleaning up:
 new linux-image-6.12.25-mnt-reform-arm64 package post-removal script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-6.12.25-mnt-reform-arm64_6.12.25-1+reform20250503T111130Z_arm64.deb
Error: Sub-process /usr/bin/dpkg returned an error code (1)

This happened on a freshly installed RK in a pocket reform. Others seeing the same problem?

Cheers,
Remco

I have the same problem — identical error message — on an A311D pocket reform. Weirdly the system comes back up after reboot and gives:

> uname -r
6.12.25-mnt-reform-arm64

But linux-image is still listed as upgradable with that version number. So maybe it partially succeeded? And the rest of the package updates are pending too.

I’m working on a fix. I will post here once I’m done. Sorry for the inconvenience.

No worries! Thank you for attending to this so quickly. My system seems basically fine even after the partial upgrade; all I was going to do this morning was edit some text files in emacs anyway…

The problem should be solved. Could you run apt update && apt full-upgrade and confirm?

I am still having issues:

Preconfiguring packages ...
(Reading database ... 348207 files and directories currently installed.)
Preparing to unpack .../linux-image-6.12.25-mnt-reform-arm64_6.12.25-1+reform20250503T130928Z_arm64.deb ...
argv0: preinst
argv1: upgrade 6.12.25-1+reform20250503T111130Z 6.12.25-1+reform20250503T130928Z
argv2: 6.12.25-mnt-reform-arm64
argv3: /boot/vmlinuz-6.12.25-mnt-reform-arm64
Usage: /usr/bin/linux-run-hooks {preinst|postinst|prerm|postrm} MAINT-PARAMS VERSION IMAGE-PATH
       /usr/bin/linux-run-hooks headers_postinst MAINT-PARAMS VERSION

This command is intended to be called from the maintainer scripts of
Linux kernel packages.  It executes hooks installed in the appropriate
subdirectories of /etc/kernel and /usr/share/kernel.

The MAINT-PARAMS must be the parameters received by the maintainer
script, joined together with spaces.

The VERSION argument must be the kernel version string as shown by
'uname -r' and used in filenames.

The IMAGE-PATH argument must be the absolute filename of the kernel
image.
dpkg: error processing archive /var/cache/apt/archives/linux-image-6.12.25-mnt-reform-arm64_6.12.25-1+reform20250503T130928Z_arm64.deb (--unpack):
 new linux-image-6.12.25-mnt-reform-arm64 package pre-installation script subprocess returned error exit status 2
argv0: postrm
argv1: abort-upgrade 6.12.25-1+reform20250503T111130Z 6.12.25-1+reform20250503T130928Z
argv2: 6.12.25-mnt-reform-arm64
argv3: /boot/vmlinuz-6.12.25-mnt-reform-arm64
Usage: /usr/bin/linux-run-hooks {preinst|postinst|prerm|postrm} MAINT-PARAMS VERSION IMAGE-PATH
       /usr/bin/linux-run-hooks headers_postinst MAINT-PARAMS VERSION

This command is intended to be called from the maintainer scripts of
Linux kernel packages.  It executes hooks installed in the appropriate
subdirectories of /etc/kernel and /usr/share/kernel.

The MAINT-PARAMS must be the parameters received by the maintainer
script, joined together with spaces.

The VERSION argument must be the kernel version string as shown by
'uname -r' and used in filenames.

The IMAGE-PATH argument must be the absolute filename of the kernel
image.
dpkg: error while cleaning up:
 new linux-image-6.12.25-mnt-reform-arm64 package post-removal script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-6.12.25-mnt-reform-arm64_6.12.25-1+reform20250503T130928Z_arm64.deb
Error: Sub-process /usr/bin/dpkg returned an error code (1)

These are my debugging lines that I used to track down the issue. I have removed these. Did you run apt update first?

Yes, I did run apt update. I am usually working on Arch; can I provide any other info or run some command to purge some apt caches?

Something changed in the past couple minutes. I ran the apt update, apt full-upgrade steps and got the failure, and when I reran them to capture the output, it worked. :woman_shrugging:

Ah, the CI job finished at 13:59 UTC. Mirror updates happen every full hour. Maybe the mirror update at 14:00 UTC did somehow not pick up the change? But the mirror update at 15:00 UTC certainly did because the package does not contain the lines printing argv anymore.

@sontags Maybe you did not run apt update again after 15:00 UTC?

1 Like

Just ran apt update followed by apt full-upgrade and I am getting the same output reported by @sontags .

I am in the USA if that might make a difference?

If you still have problems, please give me the output of: apt-cache policy linux-base

linux-base:
  Installed: 4.11+reform20250503T111130Z1
  Candidate: 4.11+reform20250503T130928Z1
  Version table:
     4.11+reform20250503T130928Z1 990
        990 https://mntre.com/reform-debian-repo reform/main arm64 Packages
 *** 4.11+reform20250503T111130Z1 100
        100 /var/lib/dpkg/status
     4.11 500
        500 http://deb.debian.org/debian unstable/main arm64 Packages

Can you try installing linux-base with its correct version explicitly:

sudo apt install linux-base=4.11+reform20250503T130928Z1

The error you see happens because the version you have installed (4.11+reform20250503T111130Z1) has a bug.

Hmmm, this still results in the same error I posted first in this thread… @josch I guess thats me not knowing how to debian. Don’t bother to much and enjoy the weekend.

Ooooor we just fix the problem. :smiley:

Can you also show me the output of this: dpkg -l "linux-image-6.*"

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                          Version                          Architecture Description
+++-=============================================-================================-============-=================================================
rc  linux-image-6.11.2-mnt-reform-arm64           6.11.2-1+reform20241010T194100Z  arm64        Linux 6.11 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.11.4-mnt-reform-arm64           6.11.4-1+reform20241025T201754Z  arm64        Linux 6.11 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.11.7-mnt-reform-arm64           6.11.7-1+reform20241116T152555Z  arm64        Linux 6.11 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.12.12-mnt-reform-arm64          6.12.12-1+reform20250204T221140Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.12.16-mnt-reform-arm64          6.12.16-1+reform20250219T175041Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.12.17-mnt-reform-arm64          6.12.17-1+reform20250310T174627Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
ii  linux-image-6.12.19-mnt-reform-arm64          6.12.19-1+reform20250323T000715Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
un  linux-image-6.12.19-mnt-reform-arm64-unsigned <none>                           <none>       (no description available)
ii  linux-image-6.12.22-mnt-reform-arm64          6.12.22-1+reform20250425T080214Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
un  linux-image-6.12.22-mnt-reform-arm64-unsigned <none>                           <none>       (no description available)
iHR linux-image-6.12.25-mnt-reform-arm64          6.12.25-1+reform20250503T111130Z arm64        (no description available)
rc  linux-image-6.12.6-mnt-reform-arm64           6.12.6-1+reform20241228T163100Z  arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)

I’ll be back tomorrow, I had a pretty rough week. @josch Thanks for the support so far; I really appreciate that!

I am seeing the same exact problems as @sontags and have some time to debug this weekend. Here’s the output of my dpkg -l "linux-image-6.*" below:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                          Version                          Architecture Description
+++-=============================================-================================-============-=================================================
rc  linux-image-6.12.10-mnt-reform-arm64          6.12.10-1+reform20250110T183608Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.12.11-mnt-reform-arm64          6.12.11-1+reform20250130T110123Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.12.17-mnt-reform-arm64          6.12.17-1+reform20250310T174627Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.12.21-mnt-reform-arm64          6.12.21-1+reform20250403T221306Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
ii  linux-image-6.12.22-mnt-reform-arm64          6.12.22-1+reform20250412T175526Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
un  linux-image-6.12.22-mnt-reform-arm64-unsigned <none>                           <none>       (no description available)
iHR linux-image-6.12.25-mnt-reform-arm64          6.12.25-1+reform20250425T112519Z arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
un  linux-image-6.12.25-mnt-reform-arm64-unsigned <none>                           <none>       (no description available)
rc  linux-image-6.12.6-mnt-reform-arm64           6.12.6-1+reform20241228T163100Z  arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)
rc  linux-image-6.12.9-mnt-reform-arm64           6.12.9-1+reform20250110T183608Z  arm64        Linux 6.12 for 64-bit ARMv8 machines (MNT Reform)

what should I try next?

I think you have to try and fix the problem without apt. You can do it with just dpkg by performing the following steps:

apt download linux-base=4.11+reform20250503T130928Z1
sudo dpkg -i ./linux-base_4.11+reform20250503T130928Z1_all.deb

After that you can do your normal sudo apt full-upgrade because now linux-base is fixed. Tell me in case anything else is going wrong.

1 Like

That worked perfectly, thank you so much! What should I read to understand apt better? Is there an approachable introduction somewhere?

Before performing your recommended steps, I tried the command sudo apt reinstall linux-image-6.12.25-mnt-reform-arm64 because the output of dpkg -l and then dpkg --status linux-image-6.12.25-mnt-reform-arm64 said the package was half-installed and required a reinstall. Now I get:

> dpkg --status linux-image-6.12.25-mnt-reform-arm64
Package: linux-image-6.12.25-mnt-reform-arm64
Status: install ok installed
Priority: optional

Hooray! Thank you again. But I’d like to understand why:

  • dpkg -i was necessary to fix my issue — if the erro status had been just reinstall without half-installed, would apt reinstall have worked?
  • the priority on this linux-image package is optional — that seems weird, isn’t a kernel from this package absolutely required to… boot?