web-dev-qa-db-ja.com

エラーコード1を示す古いカーネルを削除できません

古いカーネルを削除して、十分な空き領域の更新を実行しようとしました。

私は試した

Sudo apt-get purge 4.4.0-81-generic

そしてそれは戻ります

gzip: stdout: No space left on device E: mkinitramfs failure cpio 141
gzip 1 update-initramfs: failed for /boot/initrd.img-4.4.0-83-generic with 1. 
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-83-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-83-generic  (--configure):  subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-83-generic: 
 linux-image-extra-4.4.0-83-generic depends on
 linux-image-4.4.0-83-generic; however: 
 Package linux-image-4.4.0-83-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.4.0-83-generic  (--configure):  dependency problems - leaving unconfigured 
Processing triggers for initramfs-tools (0.122ubuntu8.8) ... 
No apport report written because the error message indicates its a followup error from a previous failure.

update-initramfs: Generating /boot/initrd.img-4.4.0-81-generic 
depmod: WARNING: could not open /var/tmp/mkinitramfs_6MkWbI/lib/modules/4.4.0-81-generic/modules.order: No such file or directory 
depmod: WARNING: could not open /var/tmp/mkinitramfs_6MkWbI/lib/modules/4.4.0-81-generic/modules.builtin: No such file or directory
gzip: stdout: No space left on device 
E: mkinitramfs failure cpio 141
gzip 1 update-initramfs: failed for /boot/initrd.img-4.4.0-81-generic with 1. 
dpkg: error processing package initramfs-tools (--configure): 
 subprocess installed post-installation script returned error exit status 1 
Errors were encountered while processing: 
 linux-image-4.4.0-83-generic  linux-image-extra-4.4.0-83-generic 
 initramfs-tools 
E: Sub-process /usr/bin/dpkg returned an error code (1)

どうすれば解決できますか?

Ubuntu 16.04 64ビットを使用しています。

$ ls -l /boot
total 310275
-rw-r--r-- 1 prafulla root  1241623 Jul 28  2016 abi-4.4.0-34-generic
-rw-r--r-- 1 prafulla root  1242701 Oct  8  2016 abi-4.4.0-42-generic
-rw-r--r-- 1 prafulla root  1242701 Oct 19  2016 abi-4.4.0-45-generic
-rw-r--r-- 1 prafulla root  1243800 Dec 10  2016 abi-4.4.0-57-generic
-rw-r--r-- 1 prafulla root  1244118 Jan  7 06:14 abi-4.4.0-59-generic
-rw-r--r-- 1 prafulla root  1244118 Jan 18 21:29 abi-4.4.0-62-generic
-rw-r--r-- 1 prafulla root  1245512 Feb 20 19:10 abi-4.4.0-64-generic
-rw-r--r-- 1 prafulla root  1246511 Jun 27 01:15 abi-4.4.0-83-generic
-rw-r--r-- 1 prafulla root   189676 Jul 28  2016 config-4.4.0-34-generic
-rw-r--r-- 1 prafulla root   189760 Oct  8  2016 config-4.4.0-42-generic
-rw-r--r-- 1 prafulla root   189760 Oct 19  2016 config-4.4.0-45-generic
-rw-r--r-- 1 prafulla root   189991 Dec 10  2016 config-4.4.0-57-generic
-rw-r--r-- 1 prafulla root   190047 Jan  7 06:14 config-4.4.0-59-generic
-rw-r--r-- 1 prafulla root   190047 Jan 18 21:29 config-4.4.0-62-generic
-rw-r--r-- 1 prafulla root   190247 Feb 20 19:10 config-4.4.0-64-generic
-rw-r--r-- 1 prafulla root   190356 Jun 27 01:15 config-4.4.0-83-generic
drwx------ 3 root     root     4096 Jan  1  1970 efi
drwxr-xr-x 5 prafulla root     1024 Jul  5 17:14 grub
-rw-r--r-- 1 prafulla root 39251639 Jul  5 11:53 initrd.img-4.4.0-57-generic
-rw-r--r-- 1 prafulla root 39246014 Jul  5 11:53 initrd.img-4.4.0-59-generic
-rw-r--r-- 1 prafulla root 39245795 Jul  5 11:53 initrd.img-4.4.0-62-generic
-rw-r--r-- 1 prafulla root 39230522 Jul  5 11:52 initrd.img-4.4.0-64-generic
-rw-r--r-- 1 prafulla root 10396186 Jul  5 11:52 initrd.img-4.4.0-75-generic
drwx------ 2 prafulla root    12288 May 11  2016 lost+found
-rw-r--r-- 1 prafulla root   182704 Jan 28  2016 memtest86+.bin
-rw-r--r-- 1 prafulla root   184380 Jan 28  2016 memtest86+.elf
-rw-r--r-- 1 prafulla root   184840 Jan 28  2016 memtest86+_multiboot.bin
-rw------- 1 prafulla root  3866644 Jul 28  2016 System.map-4.4.0-34-generic
-rw------- 1 prafulla root  3869895 Oct  8  2016 System.map-4.4.0-42-generic
-rw------- 1 prafulla root  3869895 Oct 19  2016 System.map-4.4.0-45-generic
-rw------- 1 prafulla root  3875329 Dec 10  2016 System.map-4.4.0-57-generic
-rw------- 1 prafulla root  3875594 Jan  7 06:14 System.map-4.4.0-59-generic
-rw------- 1 prafulla root  3875553 Jan 18 21:29 System.map-4.4.0-62-generic
-rw------- 1 prafulla root  3883990 Feb 20 19:10 System.map-4.4.0-64-generic
-rw------- 1 prafulla root  3883887 Jun 27 01:15 System.map-4.4.0-83-generic
-rw------- 1 prafulla root  7046160 Jul 28  2016 vmlinuz-4.4.0-34-generic
-rw------- 1 prafulla root  7048088 Aug 19  2016 vmlinuz-4.4.0-34-generic.efi.signed
-rw------- 1 prafulla root  7053472 Oct  8  2016 vmlinuz-4.4.0-42-generic
-rw------- 1 prafulla root  7055384 Oct 13  2016 vmlinuz-4.4.0-42-generic.efi.signed
-rw------- 1 prafulla root  7054208 Oct 19  2016 vmlinuz-4.4.0-45-generic
-rw------- 1 prafulla root  7056120 Nov  8  2016 vmlinuz-4.4.0-45-generic.efi.signed
-rw------- 1 prafulla root  7067152 Dec 10  2016 vmlinuz-4.4.0-57-generic
-rw------- 1 prafulla root  7069080 Dec 27  2016 vmlinuz-4.4.0-57-generic.efi.signed
-rw------- 1 prafulla root  7069136 Jan  7 06:14 vmlinuz-4.4.0-59-generic
-rw------- 1 prafulla root  7071064 Jan 11 12:51 vmlinuz-4.4.0-59-generic.efi.signed
-rw------- 1 prafulla root  7070992 Jan 18 21:29 vmlinuz-4.4.0-62-generic
-rw------- 1 prafulla root  7072920 Feb  7 11:48 vmlinuz-4.4.0-62-generic.efi.signed
-rw------- 1 prafulla root  7087152 Feb 20 19:10 vmlinuz-4.4.0-64-generic
-rw------- 1 prafulla root  7089080 Feb 24 11:07 vmlinuz-4.4.0-64-generic.efi.signed
-rw------- 1 prafulla root  7092720 Jun 27 01:15 vmlinuz-4.4.0-83-generic

enter image description here

$ Sudo rm config-4.4.0-[3,4,5][4,2,5,7,9]-generic abi-4.4.0-[3,4,5][4,2,5,7,9]-generic initrd.img-4.4.0-[3,4,5][4,2,5,7,9]-generic System.map4.4.0-[3,4,5][4,2,5,7,9]-generic
rm: cannot remove 'config-4.4.0-[3,4,5][4,2,5,7,9]-generic': No such file or directory
rm: cannot remove 'abi-4.4.0-[3,4,5][4,2,5,7,9]-generic': No such file or directory
rm: cannot remove 'initrd.img-4.4.0-[3,4,5][4,2,5,7,9]-generic': No such file or directory
rm: cannot remove 'System.map4.4.0-[3,4,5][4,2,5,7,9]-generic': No such file or directory
1

手動で削除してスペースを作成し、後でコマンドを実行します。

これにより、現在使用されているカーネルなしで、インストールされているすべてのカーネルが一覧表示されます。

dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)

パッケージの名前がわかったら、dpkgでそれらを削除できます。

Sudo dpkg --purge linux-image-4.4.0-21-generic

古いカーネルをすべて削除した後、次のコマンドを実行して、破損した依存関係を修復できます。

Sudo apt -f install

動作しない場合は、/bootにcdし、rmコマンドで手動で削除します。現在使用されているものを削除したくないが、それに注意してください...

Sudo rm config-4.4.0-[3,4,5][4,2,5,7,9]-generic abi-4.4.0-[3,4,5][4,2,5,7,9]-generic initrd.img-4.4.0-[3,4,5][4,2,5,7,9]-generic System.map-4.4.0-[3,4,5][4,2,5,7,9]-generic vmlinuz-4.4.0-[3,4,5][4,2,5,7,9]-generic*
4
Ziazis

Install byob:でやった

Sudo apt install byobu

次に、古いカーネルを削除します。

Sudo purge-old-kernels

やった

0
ChaosPredictor