Kernel
嘗試升級 Linux 核心時出錯
我每天都去升級我的機器,但我收到了以下錯誤:
$ 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
您可以通過刪除 4.9 核心來釋放一些空間:
sudo apt purge linux-image-4.9.0-11-amd64
您的
/boot
分區快滿了。您可以通過在安裝更新之前刪除舊核心來釋放空間。如果它們是自動安裝的,您可以sudo apt-get autoremove --purge
按照連結中的說明簡單地執行。