我正在尝试清理我的 /boot 驱动器,但感觉自己陷入了恶性循环。到目前为止,我尝试过以下方法:
$ df -h
/dev/xvda1 236M 230M 0 100% /boot
$ uname -r
3.19.0-64-generic
$ dpkg --list | grep linux-image
rc linux-image-3.19.0-25-generic 3.19.0-25.26~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii linux-image-3.19.0-49-generic 3.19.0-49.55~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii linux-image-3.19.0-51-generic 3.19.0-51.58~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii linux-image-3.19.0-56-generic 3.19.0-56.62~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii linux-image-3.19.0-58-generic 3.19.0-58.64~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii linux-image-3.19.0-59-generic 3.19.0-59.66~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii linux-image-3.19.0-61-generic 3.19.0-61.69~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii linux-image-3.19.0-64-generic 3.19.0-64.72~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
rc linux-image-extra-3.19.0-25-generic 3.19.0-25.26~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii linux-image-extra-3.19.0-49-generic 3.19.0-49.55~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii linux-image-extra-3.19.0-51-generic 3.19.0-51.58~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii linux-image-extra-3.19.0-56-generic 3.19.0-56.62~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii linux-image-extra-3.19.0-58-generic 3.19.0-58.64~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii linux-image-extra-3.19.0-59-generic 3.19.0-59.66~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii linux-image-extra-3.19.0-61-generic 3.19.0-61.69~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
iF linux-image-extra-3.19.0-64-generic 3.19.0-64.72~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
rc linux-image-extra-3.19.0-65-generic 3.19.0-65.73~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
当我尝试删除一个未使用的内核时,出现以下错误:
$ sudo apt-get remove linux-image-3.19.0-49-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-generic-lts-vivid : Depends: linux-headers-3.19.0-73-generic but it is not going to be installed
linux-image-extra-3.19.0-49-generic : Depends: linux-image-3.19.0-49-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
当我尝试安装未满足的依赖项时,出现以下错误。
apt-get -f install
[...]
unable to create `/usr/src/linux-headers-3.19.0-73-generic/include/config/ath9k/common.h.dpkg-new' (while processing `./usr/src/linux-headers-3.19.0-73-generic/include/config/ath9k/common.h'): No space left on device
No apport report written because the error message indicates a disk full error
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/linux-headers-3.19.0-73-generic_3.19.0-73.81~14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
有什么建议我可以做些什么吗?我可以手动/安全地增加 /boot 驱动器的大小吗?谢谢
答案1
根据手册页:
“autoremove 用于删除那些为了满足其他软件包的依赖关系而自动安装但现在不再需要的软件包。”
第一次尝试:
apt-get -s autoremove
这将模拟自动删除的运行,它将告诉你在没有 -s 选项。如果您满意它不会删除您需要的任何内容,那么:
apt-get autoremove
注意:你的 /boot 分区似乎已经满了。你可以运行分区从实时版本 CD(例如 Knoppix)重新分配您的硬盘空间并为 /boot 提供更多的空间。