輸入命令:sudo apt-get install
報錯:
gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-4.15.0-72-generic with 1. dpkg: 處理軟件包 initramfs-tools (--configure)時出錯: 子進程 已安裝 post-installation 腳本 返回錯誤狀態 1 在處理時有錯誤發生: linux-firmware initramfs-tools E: Sub-process /usr/bin/dpkg returned an error code (1)
原因:/boot內存不夠,
輸入命令查看linux內存:df -h
看到只有28M可用。
到/boot目錄下可以看到以下幾個文件:這些與系統內核有關
輸入命令:dpkg --get-selections|grep linux
以上為查看內核情況,表示有兩個版本被安裝,4.15.0-45和4.15.0-72
查看使用的是哪個版本的系統,輸入命令:uname -a
可以將與4.15.0-45有關的刪除,即4.15.0-72以前的版本刪除
解決:
采用sudo apt-get purge刪除
輸入命令:sudo apt-get purge linux-modules-4.15.0-45-generic
sudo apt-get purge linux-image-4.15.0-45-generic
sudo apt-get purge linux-headers-4.15.0-45
再查看一下:dpkg --get-selections|grep linux
內存:df -h