Error while updating linux image

Hi all!

During the package update routine (apt update && apt upgrade) I faced with an error:

The following packages have unmet dependencies:
 linux-image-cloud-arm64 : Depends: linux-image-5.10.0-0.bpo.8-cloud-arm64 (= 5.10.46-4~bpo10+1) but 5.10.46-2~bpo10+1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

If I run the suggested command I get the following error:

Unpacking linux-image-5.10.0-0.bpo.8-cloud-arm64 (5.10.46-4~bpo10+1) over (5.10.46-2~bpo10+1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.10.0-0.bpo.8-cloud-arm64_5.10.46-4~bpo10+1_arm64.deb (--unpack):
 unable to make backup link of './boot/System.map-5.10.0-0.bpo.8-cloud-arm64' before installing new version: Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-5.10.0-0.bpo.8-cloud-arm64_5.10.46-4~bpo10+1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is the list of installed linux images:

ii  linux-image-5.10.0-0.bpo.7-cloud-arm64 5.10.40-1~bpo10+1              arm64        Linux 5.10 for arm64 cloud (signed)
ii  linux-image-5.10.0-0.bpo.8-cloud-arm64 5.10.46-2~bpo10+1              arm64        Linux 5.10 for arm64 cloud (signed)
rc  linux-image-5.9.0-0.bpo.5-cloud-arm64  5.9.15-1~bpo10+1               arm64        Linux 5.9 for arm64 cloud (signed)
iU  linux-image-cloud-arm64                5.10.46-4~bpo10+1              arm64        Linux for arm64 cloud (meta-package)

I also tried to run apt install --reinstall linux-image-cloud-arm64, but got the same error

Does anybody know how to fix the issue with linux image update?

can you try to reboot your system and run apt autoremove afterwards.

once done apt install --reinstall linux-image-5.10.0-0.bpo.8-cloud-arm64

apt autoremove after reboot shows the same error:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-image-cloud-arm64 : Depends: linux-image-5.10.0-0.bpo.8-cloud-arm64 (= 5.10.46-4~bpo10+1) but 5.10.46-2~bpo10+1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

as well as apt install --reinstall linux-image-5.10.0-0.bpo.8-cloud-arm64:

Preparing to unpack .../linux-image-5.10.0-0.bpo.8-cloud-arm64_5.10.46-4~bpo10+1_arm64.deb ...
Unpacking linux-image-5.10.0-0.bpo.8-cloud-arm64 (5.10.46-4~bpo10+1) over (5.10.46-2~bpo10+1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.10.0-0.bpo.8-cloud-arm64_5.10.46-4~bpo10+1_arm64.deb (--unpack):
 unable to make backup link of './boot/System.map-5.10.0-0.bpo.8-cloud-arm64' before installing new version: Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-5.10.0-0.bpo.8-cloud-arm64_5.10.46-4~bpo10+1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have found some information here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1318951
They recommend to boot into another installed image, purge the defective one and reinstall it. But I do not know how to boot Pi into another image. Also, adding lines

do_symlinks = No
no_symlinks = Yes

to /etc/kernel-img.conf did nothing (but I didn’t reboot the Pi afterwards)

could you let me know what SBC you are running? is it a Raspberry Pi?

Yes, it is Raspberry Pi 4 Model B with 8Gb RAM
Currently running DietPi 7.4.2 - cannot update it because of the issue.

hmm I’m wonder why you have linux-image-cloud-arm64 package installed at all. Usually it is used on cloud platforms supporting arm64 virtual machines. As well it is installed from Buster backports indicated by bpo10 within the package name. Was there any reason to have it installed? :thinking:

Usually an Raspberry Pi, kernel from Raspbian repository is used and not a kernel for cloud platform.

Let me ping our developer MichaIng

No, I didn’t change the image package by myself. Or at least at my own will: it might be installed by some other package…

can you check if the Raspbian kernel package is installed

dpkg -l *kernel*

It shows the following output:

| 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
+++-======================-==============-============-=================================
un  debian-kernel-handbook <none>         <none>       (no description available)
un  kernel-common          <none>         <none>       (no description available)
ii  raspberrypi-kernel     1:1.20210805-1 arm64        Raspberry Pi bootloader

UPD. I didn’t find any v.5 images except for cloud and backports available:

apt list linux-image*
Listing... Done
linux-image-4.19.0-12-arm64/oldstable 4.19.152-1 arm64
linux-image-4.19.0-12-rt-arm64/oldstable 4.19.152-1 arm64
linux-image-4.19.0-14-arm64-dbg/oldstable 4.19.171-2 arm64
linux-image-4.19.0-14-arm64-unsigned/oldstable 4.19.171-2 arm64
linux-image-4.19.0-14-arm64/oldstable 4.19.171-2 arm64
linux-image-4.19.0-14-rt-arm64-dbg/oldstable 4.19.171-2 arm64
linux-image-4.19.0-14-rt-arm64-unsigned/oldstable 4.19.171-2 arm64
linux-image-4.19.0-14-rt-arm64/oldstable 4.19.171-2 arm64
linux-image-4.19.0-16-arm64-dbg/oldstable 4.19.181-1 arm64
linux-image-4.19.0-16-arm64-unsigned/oldstable 4.19.181-1 arm64
linux-image-4.19.0-16-arm64/oldstable 4.19.181-1 arm64
linux-image-4.19.0-16-rt-arm64-dbg/oldstable 4.19.181-1 arm64
linux-image-4.19.0-16-rt-arm64-unsigned/oldstable 4.19.181-1 arm64
linux-image-4.19.0-16-rt-arm64/oldstable 4.19.181-1 arm64
linux-image-4.19.0-17-arm64-dbg/oldstable 4.19.194-3 arm64
linux-image-4.19.0-17-arm64-unsigned/oldstable 4.19.194-3 arm64
linux-image-4.19.0-17-arm64/oldstable 4.19.194-3 arm64
linux-image-4.19.0-17-rt-arm64-dbg/oldstable 4.19.194-3 arm64
linux-image-4.19.0-17-rt-arm64-unsigned/oldstable 4.19.194-3 arm64
linux-image-4.19.0-17-rt-arm64/oldstable 4.19.194-3 arm64
linux-image-4.19.0-6-arm64/oldstable 4.19.67-2+deb10u2 arm64
linux-image-4.19.0-6-rt-arm64/oldstable 4.19.67-2+deb10u2 arm64
linux-image-4.19.0-8-arm64/oldstable 4.19.98-1+deb10u1 arm64
linux-image-4.19.0-8-rt-arm64/oldstable 4.19.98-1+deb10u1 arm64
linux-image-4.19.0-9-arm64/oldstable 4.19.118-2+deb10u1 arm64
linux-image-4.19.0-9-rt-arm64/oldstable 4.19.118-2+deb10u1 arm64
linux-image-5.10.0-0.bpo.7-arm64/buster-backports 5.10.40-1~bpo10+1 arm64
linux-image-5.10.0-0.bpo.7-cloud-arm64/buster-backports,now 5.10.40-1~bpo10+1 arm64 [installed,automatic]
linux-image-5.10.0-0.bpo.7-rt-arm64/buster-backports 5.10.40-1~bpo10+1 arm64
linux-image-5.10.0-0.bpo.8-arm64-dbg/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-5.10.0-0.bpo.8-arm64-unsigned/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-5.10.0-0.bpo.8-arm64/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-5.10.0-0.bpo.8-cloud-arm64-dbg/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-5.10.0-0.bpo.8-cloud-arm64-unsigned/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-5.10.0-0.bpo.8-cloud-arm64/buster-backports 5.10.46-4~bpo10+1 arm64 [upgradable from: 5.10.46-2~bpo10+1]
linux-image-5.10.0-0.bpo.8-rt-arm64-dbg/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-5.10.0-0.bpo.8-rt-arm64-unsigned/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-5.10.0-0.bpo.8-rt-arm64/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-5.9.0-0.bpo.5-cloud-arm64/now 5.9.15-1~bpo10+1 arm64 [residual-config]
linux-image-arm64-dbg/oldstable 4.19+105+deb10u12 arm64
linux-image-arm64-signed-template/oldstable 4.19.194-3 arm64
linux-image-arm64/oldstable 4.19+105+deb10u12 arm64
linux-image-cloud-arm64-dbg/buster-backports 5.10.46-4~bpo10+1 arm64
linux-image-cloud-arm64/buster-backports,now 5.10.46-4~bpo10+1 arm64 [installed,automatic]
linux-image-rt-arm64-dbg/oldstable 4.19+105+deb10u12 arm64
linux-image-rt-arm64/oldstable 4.19+105+deb10u12 arm64

usually there is no need to install any linux-image package on RPi. This should not be needed.

OK. Should I just delete the installed image?

Don’t do anything at the moment. I would recommend to wait on MichaIng . Usually he has good ideas on such issues.

Wilco

Luckily this cloud VM kernel is not loaded by the physical RPi anyway. These would never be automatically installed by any other Debian package or any of our software options, but indeed one output line indicated that it was pulled as dependency by another APT package, a 3rd party package most likely:

linux-image-cloud-arm64/buster-backports,now 5.10.46-4~bpo10+1 arm64 [installed,automatic]

Can you try to purge it (do not confirm!) and paste the list of packages which would be purged as a result?

apt purge linux-image-5.10.0-0.bpo.7-cloud-arm64 linux-image-5.10.0-0.bpo.8-cloud-arm64linux-image-5.9.0-0.bpo.5-cloud-arm64 linux-image-cloud-arm64

That list should then show the culprit package which for strange reasons has that cloud kernel package as dependency.

That is a kernel for e.g. ESXi on ARM guests, actually good to know about it. Also I’ll just test linux-image-cloud-amd64 on our supported VMs, as it is much smaller than the regular x86_64 kernel :slight_smile:.

Thank you for the advice!
I have executed the command and this was the output:

# apt purge linux-image-5.10.0-0.bpo.7-cloud-arm64 linux-image-5.10.0-0.bpo.8-cloud-arm64 linux-image-5.9.0-0.bpo.5-cloud-arm64 linux-image-cloud-arm64
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cpio initramfs-tools initramfs-tools-core klibc-utils libklibc linux-base
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  linux-image-5.10.0-0.bpo.7-cloud-arm64* linux-image-5.10.0-0.bpo.8-cloud-arm64* linux-image-5.9.0-0.bpo.5-cloud-arm64* linux-image-cloud-arm64*
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 163 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

Strange, nothing else would be purged. Not sure why the package has the “automatic” mark then. However, so you can confirm to purge them and also remove the other packages those pulled again as dependency, like the initramfs, which is not required on RPi:

apt purge --autoremove linux-image-5.10.0-0.bpo.7-cloud-arm64 linux-image-5.10.0-0.bpo.8-cloud-arm64 linux-image-5.9.0-0.bpo.5-cloud-arm64 linux-image-cloud-arm64

I have purged all the linux-image* packages you mentioned + their dependencies (via --autoremove) and updated DietPi to 7.5.2.
Everything works fine! Thank you!!!
The case is now resolved. How can I mark it?

I marked it as resolved now