Routine system update failed (Ubuntu 22.04.4 LTS)
Jeffrey Walton
noloader at gmail.com
Sat Sep 21 01:35:01 UTC 2024
On Fri, Sep 20, 2024 at 5:18 PM Bo Berglund <bo.berglund at gmail.com> wrote:
>
> Based on a discussion post here by Ian Burntlett some time ago I have compiled a
> script to do system updates which looks like this:
>
> -----------
> #!/bin/bash
> if [ "$1" != "Y" ]; then
> echo "Error! Call syntax: sudo $0 Y"
> echo "Try again!"
> exit -1
> fi
>
> set -e # exit immediately if a command returns a non-zero status
> set -x # print a trace of simple commands
>
> apt update # download package information
> apt full-upgrade -y # upgrade and remove packages if required
> apt autoremove -y
> apt autoclean # removes virtually useless files from the cache
> #apt purge # even more tidying up
>
> echo "Update completed!"
> exit 0
> -----------
You should add the appropriate error checking to the script.
> Today I ran the script on an Ubuntu system showing this on the login screen:
> Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-117-generic x86_64)
>
> But instead of ending amicably as it has in the past it showed this towards the
> end:
>
> Updating /boot/grub/menu.lst ... done
>
> /etc/kernel/postinst.d/zz-update-grub:
> Sourcing file `/etc/default/grub'
> Sourcing file `/etc/default/grub.d/init-select.cfg'
> Generating grub configuration file ...
> Found linux image: /boot/vmlinuz-5.15.0-122-generic
> Found initrd image: /boot/initrd.img-5.15.0-122-generic
> Found linux image: /boot/vmlinuz-5.15.0-117-generic
> Found initrd image: /boot/initrd.img-5.15.0-117-generic
> Found linux image: /boot/vmlinuz-5.15.0-107-generic
> Found initrd image: /boot/initrd.img-5.15.0-107-generic
> Warning: os-prober will not be executed to detect other bootable partitions.
> Systems on them will not be added to the GRUB boot configuration.
> Check GRUB_DISABLE_OS_PROBER documentation entry.
> done
> Processing triggers for initramfs-tools (0.140ubuntu13.4) ...
> update-initramfs: Generating /boot/initrd.img-5.15.0-122-generic
> zstd: error 25 : Write error : No space left on device (cannot write compressed
> block)
> E: mkinitramfs failure zstd -q -1 -T0 25 <== ERROR here!
> update-initramfs: failed for /boot/initrd.img-5.15.0-122-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)
>
> So I checked the drive situation:
>
> ~$ df -h
> Filesystem Size Used Avail Use% Mounted on
> tmpfs 96M 1.4M 95M 2% /run
> /dev/mapper/agivpnserver--vg-root 28G 19G 7.5G 72% /
> tmpfs 479M 0 479M 0% /dev/shm
> tmpfs 5.0M 0 5.0M 0% /run/lock
> /dev/sda1 470M 394M 52M 89% /boot
> tmpfs 96M 32K 96M 1% /run/user/1000
>
> I cannot see where the disk space problem is located...
> There is 11% left on /boot, is that the problem and if so what to do about it?
>
> Any advice greatly appreciated!
1. Add error checking to the script.
2. /boot is too small for your needs. Increase the size to 768 MB or 1
GB. Or remove some old kernels.
3. Do not run clean and purge until after a reboot.
Jeff
More information about the ubuntu-users
mailing list