/boot의 디스크 공간이 부족할 때 삭제할 커널 버전은 무엇입니까?

/boot의 디스크 공간이 부족할 때 삭제할 커널 버전은 무엇입니까?

Ubuntu 20.04에서 실행 중일 때 업데이트를 시도하는 동안 /boot의 디스크 공간 부족 오류 메시지가 나타납니다.

The upgrade needs a total of 228 M free space on disk '/boot'. Please free at least an additional 24,8 M of disk space on '/boot'.

내 /boot 폴더에 다음 파일이 있습니다.

/boot
total 460452
drwx------ 3 root root      4096 Jan  1  1970 efi
-rw-r--r-- 1 root root    184884 Aug 18  2020 memtest86+_multiboot.bin
-rw-r--r-- 1 root root    184380 Aug 18  2020 memtest86+.elf
-rw-r--r-- 1 root root    182704 Aug 18  2020 memtest86+.bin
drwx------ 2 root root     16384 Feb  2  2021 lost+found
-rw------- 1 root root   6219821 Jan  6 17:21 System.map-5.15.0-58-generic
-rw-r--r-- 1 root root    262181 Jan  6 17:21 config-5.15.0-58-generic
-rw------- 1 root root  11450528 Jan  6 17:21 vmlinuz-5.15.0-58-generic
-rw-r--r-- 1 root root 217500477 Jan 20 06:33 initrd.img-5.15.0-58-generic
-rw------- 1 root root   6221223 Jan 25 10:27 System.map-5.15.0-60-generic
-rw-r--r-- 1 root root    262215 Jan 25 10:27 config-5.15.0-60-generic
-rw------- 1 root root  11458344 Jan 25 10:29 vmlinuz-5.15.0-60-generic
lrwxrwxrwx 1 root root        25 Feb  9 06:53 vmlinuz.old -> vmlinuz-5.15.0-58-generic
lrwxrwxrwx 1 root root        25 Feb  9 06:53 vmlinuz -> vmlinuz-5.15.0-60-generic
lrwxrwxrwx 1 root root        28 Feb  9 06:53 initrd.img.old -> initrd.img-5.15.0-58-generic
lrwxrwxrwx 1 root root        28 Feb  9 06:53 initrd.img -> initrd.img-5.15.0-60-generic
-rw-r--r-- 1 root root 217514515 Feb  9 06:53 initrd.img-5.15.0-60-generic
drwxr-xr-x 4 root root      4096 Feb  9 06:54 grub

"uname -a" 명령은 다음을 반환합니다.

uname -a
Linux balazskocsis 5.15.0-60-generic #66~20.04.1-Ubuntu SMP Wed Jan 25 09:41:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

dpkg 패키지를 나열하면 다음과 같은 결과가 나옵니다.

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
linux-generic-hwe-20.04
linux-headers-5.15.0-58-generic
linux-headers-5.8.0-63-generic
linux-headers-generic-hwe-20.04
linux-hwe-5.15-headers-5.15.0-58
linux-hwe-5.8-headers-5.8.0-63
linux-image-5.15.0-58-generic
linux-image-generic-hwe-20.04
linux-libc-dev:amd64
linux-modules-5.15.0-58-generic
linux-modules-extra-5.15.0-58-generic

커널 버전 5-15.0-58을 제거 명령으로 정리해야 한다고 생각합니다.

sudo apt-get -y purge linux-modules-5.15.0-58-generic

하지만 잘 모르겠습니다.

이것을 올바르게 해석하면 다음과 같습니다.

lrwxrwxrwx 1 root root        25 Feb  9 06:53 vmlinuz.old -> vmlinuz-5.15.0-58-generic
lrwxrwxrwx 1 root root        25 Feb  9 06:53 vmlinuz -> vmlinuz-5.15.0-60-generic

현재 버전은 5.15.0-60이고 5.15.0-58 버전은 제거할 수 있습니다.

/boot 폴더 목록 및 uname -a의 출력을 고려할 때 5.15.0-58 버전을 제거해도 안전합니까?

답변1

커널 버전 5.15.0-60이 제대로 작동한다고 확신한다면 커널 버전 5-15.0-58을 제거할 수 있습니다.

내 시스템에서는 이전 커널에 대해 다음 파일이 자동으로 제거됩니다.

linux-modules-extra-5.15.0-xx-generic
linux-modules-5.15.0-xx-generic
linux-image-5.15.0-xx-generic
linux-headers-5.15.0-xx-generic
linux-headers-5.15.0-xx

따라서 다음을 실행할 수 있습니다.

sudo apt remove --purge linux-modules-extra-5.15.0-58-generic linux-modules-5.15.0-58-generic linux-image-5.15.0-58-generic linux-headers-5.15.0-58-generic linux-headers-5.15.0-58

하지만 이렇게 하면안전망을 제거하다백업 커널(이전 커널)을 설치해야 하며작동하는 커널 1개시스템에서.

장기적으로는 /boot파티션을 확장하는 것이 훨씬 더 바람직할 것입니다. 그러면 Ubuntu는 2개의 작동 커널이 설치된 상태에서 정상적으로 실행될 수 있습니다.

관련 정보