系统信息

系统信息

我像每天一样升级我的机器,但收到以下错误:

$ sudo apt-get update && sudo apt-get upgrade

Hit:1 http://ftp.uk.debian.org/debian buster InRelease
Hit:2 http://security.debian.org/debian-security buster/updates InRelease                                              
Hit:3 http://ftp.uk.debian.org/debian buster-updates InRelease                                                         
Hit:4 https://updates.signal.org/desktop/apt xenial InRelease                                                          
Hit:5 https://packagecloud.io/AtomEditor/atom/any any 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 linux-image-4.19.0-8-amd64 (4.19.98-1+deb10u1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-8-amd64
pigz: abort: write error on <stdout> (No space left on device)
E: mkinitramfs failure cpio 141 pigz 28
update-initramfs: failed for /boot/initrd.img-4.19.0-8-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-4.19.0-8-amd64 (--configure):
 installed linux-image-4.19.0-8-amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-4.19.0-8-amd64
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

我相信以下行可能是问题的原因,但我不确定如何解决:

pigz: abort: write error on <stdout> (No space left on device)

系统信息

$ uname -a
Linux debian 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux

$ ls -la /boot/
drwxr-xr-x  5 root root     1024 Apr 29 08:54 .
drwxr-xr-x 22 root root     4096 Feb 11 05:39 ..
-rw-r--r--  1 root root   206361 Nov 11 00:30 config-4.19.0-6-amd64
-rw-r--r--  1 root root   206194 Apr 27 06:05 config-4.19.0-8-amd64
-rw-r--r--  1 root root   186598 Sep 20  2019 config-4.9.0-11-amd64
drwx------  3 root root     4096 Jan  1  1970 efi
drwxr-xr-x  5 root root     1024 Feb 11 05:39 grub
-rw-r--r--  1 root root 62662464 Feb  9 19:01 initrd.img-4.19.0-6-amd64
-rw-r--r--  1 root root 62708576 Feb 11 05:39 initrd.img-4.19.0-8-amd64
-rw-r--r--  1 root root 47360778 Oct 25  2019 initrd.img-4.9.0-11-amd64
drwx------  2 root root    12288 Jan 27  2019 lost+found
-rw-r--r--  1 root root  3410671 Nov 11 00:30 System.map-4.19.0-6-amd64
-rw-r--r--  1 root root  3408461 Apr 27 06:05 System.map-4.19.0-8-amd64
-rw-r--r--  1 root root  3203475 Sep 20  2019 System.map-4.9.0-11-amd64
-rw-r--r--  1 root root  5270768 Nov 11 00:30 vmlinuz-4.19.0-6-amd64
-rw-r--r--  1 root root  5274864 Apr 27 06:05 vmlinuz-4.19.0-8-amd64
-rw-r--r--  1 root root  4249376 Sep 20  2019 vmlinuz-4.9.0-11-amd64

$ sudo dpkg -l | grep linux-image
ii  linux-image-4.19.0-6-amd64             4.19.67-2+deb10u2                    amd64        Linux 4.19 for 64-bit PCs (signed)
iF  linux-image-4.19.0-8-amd64             4.19.98-1+deb10u1                    amd64        Linux 4.19 for 64-bit PCs (signed)
ii  linux-image-4.9.0-11-amd64             4.9.189-3+deb9u1                     amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-amd64                      4.19+105+deb10u3                     amd64        Linux for 64-bit PCs (meta-package)

$ sudo cat /var/log/dpkg.log
2020-04-29 08:54:32 startup packages configure
2020-04-29 08:54:32 configure linux-image-4.19.0-8-amd64:amd64 4.19.98-1+deb10u1 <none>
2020-04-29 08:54:32 status half-configured linux-image-4.19.0-8-amd64:amd64 4.19.98-1+deb10u1

$ df
Filesystem                  1K-blocks      Used Available Use% Mounted on
udev                          3987600         0   3987600   0% /dev
tmpfs                          804084      9672    794412   2% /run
/dev/mapper/debian--vg-root 220799920 117407476  92106736  57% /
tmpfs                         4020420    165216   3855204   5% /dev/shm
tmpfs                            5120         4      5116   1% /run/lock
tmpfs                         4020420         0   4020420   0% /sys/fs/cgroup
/dev/sdb1                   114854440  84891720  24085372  78% /mnt/Extended
/dev/sda2                      241965    208213     21260  91% /boot
/dev/sda1                      523248      5220    518028   1% /boot/efi
tmpfs                          804084        20    804064   1% /run/user/1000
/dev/sdd2                    15006688     41004  14183656   1% /media/squire/GENERAL

答案1

您可以通过删除 4.9 内核来释放一些空间:

sudo apt purge linux-image-4.9.0-11-amd64

答案2

您的/boot分区已接近满。您可以通过以下方式释放空间删除旧内核在安装更新之前。如果它们是自动安装的,您只需sudo apt-get autoremove --purge按照链接中的说明运行即可。

答案3

Debian 10 升级存在一个问题,在我的一台服务器上导致了同样的问题,生成的 initrd.img-4.19.0-9-amd64 为 128MB,而之前的所有服务器大约为 30MB!

当最新的 apt-get 更新显示有一个可用的新映像时,我刚刚解决了这个问题,因此我用另一台服务器的副本替换了巨大的版本(以防升级出现问题)并安装了升级。升级后构建了一个新的 initrd.img-4.19.0-9-amd64,它是 29MB,与我其他服务器上的版本非常相似。

相关内容