apt update failed due to lack of space

Kernels & Hardware, configuring network, installing services

apt update failed due to lack of space

Postby PsySc0rpi0n » 2021-02-11 22:09

Hello.

While performing an "apt update && apt upgrade" I end up getting this error:

Code: Select all
$ sudo apt -y upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.19.0-12-amd64 linux-headers-4.19.0-12-common linux-image-4.19.0-12-amd64
Use 'sudo apt autoremove' to remove them.
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.
Setting up initramfs-tools (0.133+deb10u1) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.133+deb10u1) ...
update-initramfs: Generating /boot/initrd.img-4.19.0-14-amd64
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries
    nor crypto modules. If that's on purpose, you may want to uninstall the
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs
    integration and avoid this warning.
W: Possible missing firmware /lib/firmware/amdgpu/vega20_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_uvd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_vce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_smc.bin for module amdgpu

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.19.0-14-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)


but I still have plenty of space in my SDD.
Code: Select all
$ df -h
Filesystem                    Size  Used Avail Use% Mounted on
udev                          7.8G     0  7.8G   0% /dev
tmpfs                         1.6G   18M  1.6G   2% /run
/dev/mapper/psyHost--vg-root  222G   52G  159G  25% /
tmpfs                         7.8G  420M  7.4G   6% /dev/shm
tmpfs                         5.0M  4.0K  5.0M   1% /run/lock
tmpfs                         7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/sda2                     237M  235M     0 100% /boot
/dev/sda1                     511M  5.2M  506M   1% /boot/efi
/dev/sdb1                     458G  188G  248G  44% /media/Storage
/dev/sdc1                     1.8T  1.1T  662G  62% /media/WdElements
tmpfs                         1.6G   16K  1.6G   1% /run/user/1000
tmpfs                         1.6G   40K  1.6G   1% /run/user/1001


So, why it complains about missing space?
User avatar
PsySc0rpi0n
 
Posts: 247
Joined: 2012-10-24 13:54
Location: Portugal

Re: apt update failed due to lack of space

Postby PsySc0rpi0n » 2021-02-11 22:15

I just found out that the problem seems to be on my boot partition which is a uefi boot partition.

I checked apt logs and found this:

Code: Select all
grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi/net.mod' to `/boot/grub/x86_64-efi/net.mod': No space left on device.
Failed: grub-install --target=x86_64-efi 
WARNING: Bootloader is not properly installed, system may not be bootable


Then I checked "df -h" again and I notcied the boot partition is 100% used:
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 7.8G 0 7.8G 0% /dev
tmpfs 1.6G 18M 1.6G 2% /run
/dev/mapper/psyHost--vg-root 222G 52G 159G 25% /
tmpfs 7.8G 360M 7.5G 5% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/sda2 237M 235M 0 100% /boot
/dev/sda1 511M 5.2M 506M 1% /boot/efi
/dev/sdb1 458G 188G 248G 44% /media/Storage
/dev/sdc1 1.8T 1.1T 662G 62% /media/WdElements
tmpfs 1.6G 16K 1.6G 1% /run/user/1000
tmpfs 1.6G 40K 1.6G 1% /run/user/1001


Is it safe to try to change this partition size?


Edited;

Ok, seems that there are files in this partition I can remove. Old kernel files can be removed and I can free up some space this way!
Upgrade went now until the end but I still would like to fix this problem:

Code: Select all
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries
    nor crypto modules. If that's on purpose, you may want to uninstall the
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs
    integration and avoid this warning.


Why I get this warning ?
Last edited by PsySc0rpi0n on 2021-02-11 22:39, edited 1 time in total.
User avatar
PsySc0rpi0n
 
Posts: 247
Joined: 2012-10-24 13:54
Location: Portugal

Re: apt update failed due to lack of space

Postby mm3100 » 2021-02-11 22:35

For start you can delete old kernel images, apt already suggests so

Code: Select all
The following packages were automatically installed and are no longer required:
  linux-headers-4.19.0-12-amd64 linux-headers-4.19.0-12-common linux-image-4.19.0-12-amd64
Use 'sudo apt autoremove' to remove them.


So for start run

Code: Select all
sudo apt autoremove


Then you can check if you any more versions installed with
Code: Select all
apt list linux-image* | grep installed


As for resizing that depends if you have free space after sda2 partition. Otherwise you would need to shift entire partitions to make space. Or you could try to resize /boot/efi partition to make space. Can you copy what returns
Code: Select all
lsblk
mm3100
 
Posts: 57
Joined: 2020-10-21 21:39

Re: apt update failed due to lack of space

Postby PsySc0rpi0n » 2021-02-11 22:40

mm3100 wrote:For start you can delete old kernel images, apt already suggests so

Code: Select all
The following packages were automatically installed and are no longer required:
  linux-headers-4.19.0-12-amd64 linux-headers-4.19.0-12-common linux-image-4.19.0-12-amd64
Use 'sudo apt autoremove' to remove them.


So for start run

Code: Select all
sudo apt autoremove


Then you can check if you any more versions installed with
Code: Select all
apt list linux-image* | grep installed


As for resizing that depends if you have free space after sda2 partition. Otherwise you would need to shift entire partitions to make space. Or you could try to resize /boot/efi partition to make space. Can you copy what returns
Code: Select all
lsblk



Thank you for the quick answer.
I edited my previous post with an, at least, temporary solution.
The lack of space was in /boot partition.

I ran the "autoremove" and got this:

Code: Select all
$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-4.19.0-12-amd64 linux-headers-4.19.0-12-common linux-image-4.19.0-12-amd64
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 326 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 365659 files and directories currently installed.)
Removing linux-headers-4.19.0-12-amd64 (4.19.152-1) ...
Removing linux-headers-4.19.0-12-common (4.19.152-1) ...
Removing linux-image-4.19.0-12-amd64 (4.19.152-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.19.0-12-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-4.19.0-14-amd64
Found initrd image: /boot/initrd.img-4.19.0-14-amd64
Found linux image: /boot/vmlinuz-4.19.0-13-amd64
Found initrd image: /boot/initrd.img-4.19.0-13-amd64
Adding boot menu entry for EFI firmware configuration
done



Code: Select all
apt list linux-image* | grep installed


returns:
Code: Select all
$ apt list linux-image* | grep installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

linux-image-4.19.0-11-amd64/now 4.19.146-1 amd64 [installed,local]
linux-image-4.19.0-13-amd64/stable,now 4.19.160-2 amd64 [installed,automatic]
linux-image-4.19.0-14-amd64/stable,stable,now 4.19.171-2 amd64 [installed,automatic]
linux-image-amd64/stable,stable,now 4.19+105+deb10u9 amd64 [installed]



and I still have 50% of this SDD unpartitioned space as you can see with lsblk
Code: Select all
$ lsblk
NAME                   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                      8:0    0 465.8G  0 disk
├─sda1                   8:1    0   512M  0 part /boot/efi
├─sda2                   8:2    0   244M  0 part /boot
└─sda3                   8:3    0   465G  0 part
  ├─psyHost--vg-root   254:0    0 225.9G  0 lvm  /
  └─psyHost--vg-swap_1 254:1    0  15.9G  0 lvm  [SWAP]
sdb                      8:16   0 465.8G  0 disk
└─sdb1                   8:17   0 465.8G  0 part /media/Storage
sdc                      8:32   0   1.8T  0 disk
└─sdc1                   8:33   0   1.8T  0 part /media/WdElements
sr0                     11:0    1  1024M  0 rom 
mmcblk0                179:0    0   1.9G  0 disk
└─mmcblk0p1            179:1    0   1.9G  0 part


But I know I had many problems when I first tried to install Debian with UEFI support. I had to chroot to this /boot partition and fix a couple of problems.
I just hope this upgrade won't break my boot again. I can't afford to "lose" my laptop because my daughter is using it for online classes. If this goes wrong in the next reboot, I will have to reinstall Debian again probably or try to fix the boot again!
User avatar
PsySc0rpi0n
 
Posts: 247
Joined: 2012-10-24 13:54
Location: Portugal

Re: apt update failed due to lack of space

Postby mm3100 » 2021-02-12 01:12

It seems you have 2 more of the old kernel installed, if device worked with those, it would be wise to leave at least 1 of them, in case you have to go back. You could delete one of them. But do that only after you reboot, to make sure you are running in newest kernel.

Code: Select all
sudo apt remove linux-image-4.19.0-13-amd64


Try to update and upgrade again if it was trying to install new kernel.
As for making sure it boot properly after restart run this

Code: Select all
sudo update-initramfs -u


That should ensure that everything is set right.

Edit:
Forgot about partition thing. All that free space you have left on your SSD is in lvm partition. Lvm is great if you have to expand partitions with free space inside of it, here you have given it all of rest of free space. Only thing you could do is resize whole sda3 and move it up. But I wouldn't recommend it, just keep an eye on your /boot partition after each kernel upgrade. And delete old unused ones, and make sure you have at least 1 old one as backup.
Last edited by mm3100 on 2021-02-12 01:22, edited 1 time in total.
mm3100
 
Posts: 57
Joined: 2020-10-21 21:39

Re: apt update failed due to lack of space

Postby mm3100 » 2021-02-12 01:20

As for that warning you are getting
Code: Select all
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries
    nor crypto modules. If that's on purpose, you may want to uninstall the
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs
    integration and avoid this warning.


It is part of initramfs that is used for decrypting.
https://packages.debian.org/buster/cryptsetup-initramfs

If you have encrypted partitions like luks it would be used for it. But looking at your lsblk it seems you don't have them. If you aren't using partition encryption you can remove that package.

Code: Select all
sudo apt remove cryptsetup-initramfs


Just look as to what it says it is going to remove, in case it tries to do something odd. That warning is harmless in any way.

For example this is how my disks look like.
Code: Select all
NAME                MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                   8:0    0 111.8G  0 disk 
├─sda1                8:1    0   512M  0 part  /boot/efi
├─sda2                8:2    0   244M  0 part  /boot
└─sda3                8:3    0 111.1G  0 part 
  └─sda3_crypt      253:0    0   111G  0 crypt
    ├─Debian-root   253:1    0  19.6G  0 lvm   /
    ├─Debian-var    253:2    0   6.8G  0 lvm   /var
    ├─Debian-swap_1 253:3    0   7.9G  0 lvm   [SWAP]
    ├─Debian-tmp    253:4    0   1.2G  0 lvm   /tmp
    └─Debian-home   253:5    0  75.5G  0 lvm   /home
sr0                  11:0    1  1024M  0 rom   


You can see that I have encrypted partition, for which that package is used for.
mm3100
 
Posts: 57
Joined: 2020-10-21 21:39

Re: apt update failed due to lack of space

Postby PsySc0rpi0n » 2021-02-12 06:47

Thanks for the replies.

I don't have any of my main partitions encrypted, but I use cryptsetup to encrypt volumes I have, so I need cryptesetup.

As for the kernels, when my daughter is done today with classes, I'll run the "update-initramfs -u" and then will reboot. If things go wrong, I have the weekend to try to fix it.

Thanks
Psy
User avatar
PsySc0rpi0n
 
Posts: 247
Joined: 2012-10-24 13:54
Location: Portugal

Re: apt update failed due to lack of space

Postby p.H » 2021-02-12 08:42

PsySc0rpi0n wrote:So, why it complains about missing space?

Because your /boot partition is too small by today's standards. Kernels grow bigger, initramfs' grow bigger, GRUB grows bigger.
With this size you will have to limit the number of installed kernels.

PsySc0rpi0n wrote:Why I get this warning ?

Because the package cryptsetup-initramfs is installed but you do not seem to have any encrypted volume which must be unlocked at initramfs time (containing /, /usr or swap for hibernation).

PsySc0rpi0n wrote:my boot partition which is a uefi boot partition.

No, the EFI system partition is /dev/sda1 which is oversized and almost empty.

mm3100 wrote:As for resizing that depends if you have free space after sda2 partition.

There is none.

mm3100 wrote:Otherwise you would need to shift entire partitions to make space.

My advice : don't do that.

mm3100 wrote:Or you could try to resize /boot/efi partition to make space.

Yes. Unmount both sda1 and sda2, use Gparted to reduce sda1 (50 MB is more than enough) and use the freed space to move and grow sda2.

PsySc0rpi0n wrote: I still have 50% of this SDD unpartitioned space as you can see with lsblk

No, you don't. Partitions take all the space. You only have available space in the LVM physical volume for logical volumes, not for partitions.
You could also reduce sda3 and create a new bigger partition for /boot at the end of the drive. Or you could create a new logical volume for /boot, as GRUB supports LVM. Or you could just move /boot into the / filesystem and stop using sda2, as a separate /boot is not required. Note : these options may require to reinstall GRUB.

PsySc0rpi0n wrote:I don't have any of my main partitions encrypted, but I use cryptsetup to encrypt volumes I have, so I need cryptesetup.

You only need the cryptsetup program which is in the package cryptsetup-bin. But you do not need the dummy package cryptsetup which depends on the package cryptsetup-initramfs which displays the warning.
p.H
 
Posts: 1668
Joined: 2017-09-17 07:12


Return to System configuration

Who is online

Users browsing this forum: No registered users and 19 guests

fashionable