常常升級Linux內核,致使更新時警告/boot分區空間不足。這是覺得屢次升級內核後,致使內核版本太多,清理一下沒用的內核文件就好了。linux
dpkg -l 'linux-image-*' | grep '^ii' 或 dpkg --get-selections |grep linux-image
ii linux-image-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP ii linux-image-4.4.0-22-generic 4.4.0-22.40 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP ii linux-image-4.4.0-23-generic 4.4.0-23.41 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP ii linux-image-extra-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP ii linux-image-extra-4.4.0-22-generic 4.4.0-22.40 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
linux-image-4.4.0-22-generic install linux-image-4.4.0-23-generic install linux-image-extra-4.4.0-22-generic install linux-image-extra-4.4.0-23-generic install linux-image-generic install
還能夠查看ui
ls /boot
abi-4.4.0-22-generic grub System.map-4.4.0-22-generic abi-4.4.0-23-generic initrd.img-4.4.0-22-generic System.map-4.4.0-23-generic config-4.4.0-22-generic initrd.img-4.4.0-23-generic vmlinuz-4.4.0-22-generic config-4.4.0-23-generic lost+found vmlinuz-4.4.0-23-generic
查看當前啓動的內核this
uname -a
Linux gen8 4.4.0-23-generic #41-Ubuntu SMP Mon May 16 23:04:25 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
刪除舊內核spa
sudo apt purge linux-image-4.4.0-21-generic
Do you want to continue? [Y/n] y
這時空間足夠了應該自動一便更新了內核.net
清楚下剩餘的,會刪除linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic這兩個code
sudo apt autoremove
Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. After this operation, 77.5 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 125503 files and directories currently installed.) Removing linux-headers-4.4.0-21-generic (4.4.0-21.37) ...
參考:http://blog.csdn.net/zht666/article/details/8776316orm