0

I tried to update my Lubuntu 22.04 system using sudo apt update, but this failed.

Subsequently I have tried to free disk space with sudo apt --purge autoremove, but this also fails:

sudo apt --purge autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 3 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.140ubuntu13.4) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.140ubuntu13.4) ...
update-initramfs: Generating /boot/initrd.img-6.5.0-35-generic
zstd: error 25 : Write error : No space left on device (cannot write compressed block) 
E: mkinitramfs failure zstd -q -1 -T0 25
update-initramfs: failed for /boot/initrd.img-6.5.0-35-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

My disk space appears adequate (to me):

df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           3.2G  2.3M  3.2G   1% /run
/dev/nvme0n1p3  468G  248G  197G  56% /
tmpfs            16G  129M   16G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
efivarfs        256K  184K   68K  74% /sys/firmware/efi/efivars
/dev/nvme0n1p2  509M  313M  159M  67% /boot
/dev/nvme0n1p1  532M  7.7M  525M   2% /boot/efi
/dev/sda1       3.6T  794G  2.7T  23% /home/paul/data
tmpfs           3.2G  6.8M  3.2G   1% /run/user/1000

I checked the linux kernels:

uname -r
6.5.0-35-generic
paul@clio:~$ dpkg --list | grep linux-image
ii  linux-image-6.5.0-28-generic                      6.5.0-28.29~22.04.1                         amd64        Signed kernel image generic
ii  linux-image-6.5.0-35-generic                      6.5.0-35.35~22.04.1                         amd64        Signed kernel image generic
ii  linux-image-generic-hwe-22.04                     6.5.0.35.35~22.04.1                         amd64        Generic Linux kernel image

I thought I could remove the older kernels, but I am not sure it is safe - the system appears to want to reinstall 6.5.0-28 and I don't know why it is saying one kernel is not fully installed or removed.

I would appreciate any help to get the system working again without breaking it further!

1 Answers1

0

In the end, I took a chance and manually deleted the old linux kernels. That did not break anything, and freed up enough space on /boot to allow update-initramfs to work. It's probably not the best solution, but it worked.