我有一个分配给 /boot 的 512MiB 分区,但 LinuxMint 不断在更新中添加很多内容,现在抱怨磁盘使用情况。
甲df -h
写道:
Filesystem Size Used Avail Use% Mounted on
udev 7,8G 0 7,8G 0% /dev
tmpfs 1,6G 9,5M 1,6G 1% /run
/dev/sdb5 48G 13G 35G 27% /
tmpfs 7,8G 326M 7,5G 5% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/sdb7 183G 59G 125G 33% /home
/dev/sdb1 484M 473M 12M 98% /boot
cgmfs 100K 0 100K 0% /run/cgmanager/fs
tmpfs 1,6G 60K 1,6G 1% /run/user/1000
如何清理未使用的内核并保持/boot
清洁?
编辑
# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-extra-4.4.0-45-generic (4.4.0-45.66) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-45-generic
Warning: No support for locale: en_US.utf8
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-45-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-45-generic (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.4.0-45-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您可以使用以下命令找出哪些软件包提供了所有内核
dpkg -S /boot/vmlinuz*
这些是占用空间的包/boot
。您可以清除不再需要的软件包(通常保留最后两个版本,并确保保留当前运行的内核)。