2

A couple of weeks ago I've upgraded Ubuntu from 18 to 20 over ssh, the process was interrupted one time because /boot partition was full (no space left on the device), I freed up the space, restarted the process and finished it. Then the system started to return errors like this, that's usually caused (again) by no space left on the device, but that's not the case anymore, space is enough

apt-get update && apt-get --with-new-pkgs upgrade
Hit:1 http://ch.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://ch.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://ch.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up initramfs-tools (0.136ubuntu6.3) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.136ubuntu6.3) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-48-generic
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-48-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
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

Two weeks ago I've fixed the issue by restarting the system with the previous kernel, manually remove and reinstall the current one (5.4.0-48-generic), restarting again the system with latest kernel.

I could do this again, but since the issue returned it will probably happen again.

Anyone has some more in depth understanding of the issue, that could allow me to fix it one time for all?

Edit: @guiverc

cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

@nobody

# dpkg -l | egrep -v '^ii|rc'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
+++-======================================-=====================================-============-===============================================================================
iF  initramfs-tools                        0.136ubuntu6.3                        all          generic modular initramfs generator (automation)
lese
  • 2,675

1 Answers1

1
wget -c http://mirrors.kernel.org/ubuntu/pool/main/i/initramfs-tools/initramfs-tools_0.136ubuntu6_all.deb

install it with dpkg directly.

sudo dpkg -i initramfs-tools_0.136ubuntu6_all.deb

Note the next steps only work when this part is running without error I mean installation from initramfs-tool removing remaining config files.

sudo apt purge $(dpkg -l | egrep '^rc' | awk '{print $2}')

or you can use

sudo dpkg -P $(dpkg -l | egrep '^rc' | awk '{print $2}')

remaining conf files can sometimes make trouble.

sudo apt update && sudo apt full-upgrade

current kernel in focal is

uname -r
5.4.0-52-generic

Make sure package linux-generic is on your system.

nobody
  • 5,437
  • Thank you mate I'll try when I'm on site, i'll probably need to reboot and there is a crypto luks partition, i'll update the thread as soon as I do it : ) – lese Oct 30 '20 at 16:16
  • I'm so sorry guys, we ended up reinstalling the distribution since we had no data in it, it was convenient. So sorry I could not try your solution – lese Nov 19 '20 at 10:55