UbubtuKylin15.04的Boot空間不足問題解決

若是常常升級Linux內核,可能致使更新時警告/boot分區空間不足,而引發後續的不少操做失敗。linux

這是覺得屢次升級內核後,致使內核版本太多,清理一下沒用的內核文件就好了。shell

查看磁盤空間:df -h
spa

查看內核的版本:code

 dpkg -l 'linux-image-*' | grep '^ii'
//或者:dpkg --get-selections |grep linux-image
還能夠經過「ls /boot」命令查看/boot中有哪些文件: ls /boot
get

abi-3.5.0-17-generic         lost+found
abi-3.5.0-21-generic         memtest86+.bin
abi-3.5.0-26-generic         memtest86+_multiboot.bin
config-3.5.0-17-generic      System.map-3.5.0-17-generic
config-3.5.0-21-generic      System.map-3.5.0-21-generic
config-3.5.0-26-generic      System.map-3.5.0-26-generic
grub                         vmlinuz-3.5.0-17-generic
initrd.img-3.5.0-17-generic  vmlinuz-3.5.0-21-generic
initrd.img-3.5.0-21-generic  vmlinuz-3.5.0-26-generic
initrd.img-3.5.0-26-generic

能夠看到都是一些內核啓動文件,很明顯有些是咱們不須要的(建議先卸載比較老的內核),不須要的就當垃圾處刪除吧。理論上,除正在用的其它的均可以卸載,但剛升級的東西可能不穩定,爲保險起見,保留1-2個以前版本備用吧

注意:卸載老的內核以前,首先用uname -a查看當前啓動的是哪一個內核(防止把當前正在使用的內核卸載了):
uname -a
Linux zht-Ubuntu 3.5.0-26-generic #42-Ubuntu SMP Fri Mar 8 23:18:20 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
===============================
卸載舊的內核,命令以下:
it

//卸載linux-image-3.5.0-17-generic
io

sudo apt-get purge linux-image-3.5.0-17-genericclass

以後根據提示輸入yes便可完成卸載。test

相關文章
相關標籤/搜索