You are not logged in.

#1 2025-04-14 21:21:01

trilobite
Member
From: Saskatchewan, Canada
Registered: 2017-06-27
Posts: 161

Problem: $ sudo apt update $ sudo apt upgrade with initramfs

TLDR: I did the usual $ sudo apt update and $ sudo apt upgrade on a computer that's been off for 2 months.

I had to do an "apt autoremove" before initramfs would update itself.

Would have thought that old kernel images (linux-image-6.1.0-26-amd64 & linux-image-6.1.0-28-amd64) would not have to be manually removed. Have not had this experience before.

Is this abnormal? (or maybe just me is abnormal?)


Full detail:
I did the usual

$ sudo apt update
$ sudo apt upgrade

It comes back with:

zstd: error 70 : Write error : cannot write block : No space left on device 
uppdate-initramfs: failed for /boot/initrd.img-6.1.0-33-amd64 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)

I do not understand "no space left on device"

when I do $ df -h, there is space. Maybe not the right kind of space?- confusing to me.

Filesystem                  Size  Used Avail Use% Mounted on
udev                        1.9G     0  1.9G   0% /dev
tmpfs                       388M  1.5M  387M   1% /run
/dev/mapper/gobey--vg-root   28G   12G   15G  43% /
tmpfs                       1.9G     0  1.9G   0% /dev/shm
tmpfs                       5.0M   12K  5.0M   1% /run/lock
/dev/mapper/gobey--vg-home  115G   86G   24G  79% /home
/dev/sda1                   455M  380M   51M  89% /boot
tmpfs                       388M   48K  388M   1% /run/user/1000

Then

$ sudo dpkg --configure -a

The same first error message.

The I do

 $ sudo apt autoremove

because random thought if not enough space, maybe???
It comes back with

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  linux-image-6.1.0-26-amd64 linux-image-6.1.0-28-amd64
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 817 MB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 207386 files and directories currently installed.)
Removing linux-image-6.1.0-28-amd64 (6.1.119-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-28-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-6.1.0-33-amd64
Found initrd image: /boot/initrd.img-6.1.0-33-amd64
Found linux image: /boot/vmlinuz-6.1.0-31-amd64
Found initrd image: /boot/initrd.img-6.1.0-31-amd64
Found linux image: /boot/vmlinuz-6.1.0-26-amd64
Found initrd image: /boot/initrd.img-6.1.0-26-amd64
Generating custom entry for: /boot/vmlinuz-6.1.0-33-amd64
Found initrd image: /boot/initrd.img-6.1.0-33-amd64
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
Removing linux-image-6.1.0-26-amd64 (6.1.112-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-26-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-6.1.0-33-amd64
Found initrd image: /boot/initrd.img-6.1.0-33-amd64
Found linux image: /boot/vmlinuz-6.1.0-31-amd64
Found initrd image: /boot/initrd.img-6.1.0-31-amd64
Generating custom entry for: /boot/vmlinuz-6.1.0-33-amd64
Found initrd image: /boot/initrd.img-6.1.0-33-amd64
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
Setting up initramfs-tools (0.142+deb12u1) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.142+deb12u1) ...
update-initramfs: Generating /boot/initrd.img-6.1.0-33-amd64

So now is good.  Should this not be auto-magical? and not manual-not-magical? Maybe this will help others.  Thanks for reading and any comments.


{Linux-using people I haven't met are friends yet to be made.}

Offline

#2 2025-04-14 22:40:21

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: Problem: $ sudo apt update $ sudo apt upgrade with initramfs

when I do $ df -h, there is space. Maybe not the right kind of space?- confusing to me.

You have a separate /boot partition

/dev/sda1                   455M  380M   51M  89% /boot

/boot is where Debian stores the initrd.img-[kernel] file and other kernel files.

That 51M available may not have been enough space for a kernel update. On my Debian Sid install, the initrd.img is 53M, the vmlinuz file is 12M

You removed 2 older kernels:

The following packages will be REMOVED:
  linux-image-6.1.0-26-amd64 linux-image-6.1.0-28-amd64

and it looks like 2 are still installed.

Did a kernel upgrade come through?

What is the output of "df -h" and "uname -a" ?


You must unlearn what you have learned.
    -- yoda

Offline

#3 2025-04-14 22:42:58

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: Problem: $ sudo apt update $ sudo apt upgrade with initramfs

Should this not be auto-magical? and not manual-not-magical?

I think you can configure the system to remove older kernels on updates. Not sure how, though.


You must unlearn what you have learned.
    -- yoda

Offline

#4 2025-04-14 23:14:34

trilobite
Member
From: Saskatchewan, Canada
Registered: 2017-06-27
Posts: 161

Re: Problem: $ sudo apt update $ sudo apt upgrade with initramfs

Boot is now at 46%.

Did a kernel upgrade come through?

Yes it looks that it is 6.1.0-31-amd64

Must have missed 29 & 30 with this machine turned off for those months.

What is the output of "df -h" and "uname -a" ?

$ df -h
Filesystem                  Size  Used Avail Use% Mounted on
udev                        1.9G     0  1.9G   0% /dev
tmpfs                       388M  1.5M  387M   1% /run
/dev/mapper/gobey--vg-root   28G   11G   16G  40% /
tmpfs                       1.9G     0  1.9G   0% /dev/shm
tmpfs                       5.0M   12K  5.0M   1% /run/lock
/dev/mapper/gobey--vg-home  115G   86G   24G  79% /home
/dev/sda1                   455M  197M  234M  46% /boot
tmpfs                       388M   48K  388M   1% /run/user/1000
$ uname -a
Linux gobey 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux

{Linux-using people I haven't met are friends yet to be made.}

Offline

#5 2025-04-14 23:30:49

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: Problem: $ sudo apt update $ sudo apt upgrade with initramfs

Look at all the space you recovered in /boot.

You'll want to keep track of the free space in /boot unless you can figure out how to delete old kernels automatically.


You must unlearn what you have learned.
    -- yoda

Offline

#6 2025-04-15 03:02:44

greenjeans
Member
Registered: 2025-01-18
Posts: 227
Website

Re: Problem: $ sudo apt update $ sudo apt upgrade with initramfs

Couple more kernel updates after that, on 6.1.0-33 here.

There have been what seems like a lot of kernel updates this year for that one, at one point I saw like 4 in just a few weeks. Just got another one this last week.

Offline

#7 2025-04-15 06:16:37

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: Problem: $ sudo apt update $ sudo apt upgrade with initramfs

If unattended-upgrades is installed that will keep the running kernel and the two most recent. Otherwise the linux-image-amd64 metapackage will only keep the current and last kernel version installed but the user needs to issue an autoremove option for the old kernels to be removed.

Last edited by Head_on_a_Stick (2025-04-15 06:38:31)

Offline

#8 2025-04-15 08:12:39

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,550
Website

Re: Problem: $ sudo apt update $ sudo apt upgrade with initramfs

This:

Head_on_a_Stick wrote:

the user needs to issue an autoremove option for the old kernels to be removed

Run 'sudo apt autoremove' as needed. Building up of old kernels is mainly only a problem if the user has a separate /boot partition, often set to ~500MB which is a bit small for recent kernels and initrd files.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#9 2025-04-15 15:46:00

trilobite
Member
From: Saskatchewan, Canada
Registered: 2017-06-27
Posts: 161

Re: Problem: $ sudo apt update $ sudo apt upgrade with initramfs

Thanks everyone. Very interesting.


{Linux-using people I haven't met are friends yet to be made.}

Offline

Board footer

Powered by FluxBB