ubuntu 系統/boot 內存不夠無法更新(apt-get update)


輸入命令: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

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM