我一直在这里搜索,并且遇到了与(如何在 /boot 中释放更多空间?)
我尝试解决方案时遇到的问题。例如:sudo apt-get purge linux-image-2.6.38-11
我得到:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'linux-image-2.6.38-11-server' for regex 'linux-image-2.6.38-11'
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-image-server : Depends: linux-image-3.2.0-36-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
这是我继承的旧版 Ubuntu 12.0.4.1 LTS 服务器上的 uname -a 报告
3.2.0-35-generic #55-Ubuntu SMP
我是否还需要调整分区大小? ls /boot 报告以下内容:
abi-2.6.38-11-server lost+found
abi-2.6.38-12-server memtest86+.bin
abi-2.6.38-13-server memtest86+_multiboot.bin
abi-2.6.38-14-server System.map-2.6.38-11-server
abi-2.6.38-15-server System.map-2.6.38-12-server
abi-2.6.38-16-server System.map-2.6.38-13-server
abi-2.6.38-8-server System.map-2.6.38-14-server
abi-3.0.0-26-server System.map-2.6.38-15-server
abi-3.2.0-34-generic System.map-2.6.38-16-server
abi-3.2.0-35-generic System.map-2.6.38-8-server
config-2.6.38-11-server System.map-3.0.0-26-server
config-2.6.38-12-server System.map-3.2.0-34-generic
config-2.6.38-13-server System.map-3.2.0-35-generic
config-2.6.38-14-server vmcoreinfo-2.6.38-11-server
config-2.6.38-15-server vmcoreinfo-2.6.38-12-server
config-2.6.38-16-server vmcoreinfo-2.6.38-13-server
config-2.6.38-8-server vmcoreinfo-2.6.38-14-server
config-3.0.0-26-server vmcoreinfo-2.6.38-15-server
config-3.2.0-34-generic vmcoreinfo-2.6.38-16-server
config-3.2.0-35-generic vmcoreinfo-2.6.38-8-server
grub vmcoreinfo-3.0.0-26-server
initrd.img-2.6.38-11-server vmlinuz-2.6.38-11-server
initrd.img-2.6.38-12-server vmlinuz-2.6.38-12-server
initrd.img-2.6.38-13-server vmlinuz-2.6.38-13-server
initrd.img-2.6.38-14-server vmlinuz-2.6.38-14-server
initrd.img-2.6.38-15-server vmlinuz-2.6.38-15-server
initrd.img-2.6.38-16-server vmlinuz-2.6.38-16-server
initrd.img-2.6.38-8-server vmlinuz-2.6.38-8-server
initrd.img-3.0.0-26-server vmlinuz-3.0.0-26-server
initrd.img-3.2.0-34-generic vmlinuz-3.2.0-34-generic
initrd.img-3.2.0-35-generic vmlinuz-3.2.0-35-generic
一位发帖者提到,他们最终使用 rm -f 来删除,因为上述方法不起作用,但这也不推荐。提前谢谢,Sir_Timbit
更新:我最终备份了所有旧的 2.6.x 内核并删除了它们。这确实消除了“/boot 正在使用 98%”警告。然而,我随后尝试执行
apt-get -f install
它运行顺利但最终出现以下错误:
update-initramfs: Generating /boot/initrd.img-3.2.0-90-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-90-generic /boot/vmlinuz-3.2.0-90-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-90-generic
Found initrd image: /boot/initrd.img-3.2.0-90-generic
Found linux image: /boot/vmlinuz-3.2.0-35-generic
Found initrd image: /boot/initrd.img-3.2.0-35-generic
Found linux image: /boot/vmlinuz-3.2.0-34-generic
Found initrd image: /boot/initrd.img-3.2.0-34-generic
Found linux image: /boot/vmlinuz-3.0.0-26-server
Found initrd image: /boot/initrd.img-3.0.0-26-server
Found linux image: /boot/vmlinuz-2.6.38-16-server
Found initrd image: /boot/initrd.img-2.6.38-16-server
Found memtest86+ image: /memtest86+.bin
done
dpkg: dependency problems prevent configuration of linux-image-server:
linux-image-server depends on linux-image-3.2.0-36-generic; however:
Package linux-image-3.2.0-36-generic is not installed.
dpkg: error processing linux-image-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up linux-headers-3.2.0-90 (3.2.0-90.128) ...
Setting up linux-headers-3.2.0-90-generic (3.2.0-90.128) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.2.0-90-generic /boot/vmlinuz-3.2.0-90-generic
Setting up linux-headers-server (3.2.0.36.43) ...
dpkg: dependency problems prevent configuration of linux-server:
linux-server depends on linux-image-server (= 3.2.0.36.43); however:
Package linux-image-server is not configured yet.
dpkg: error processing linux-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up linux-libc-dev (3.2.0-36.57) ...
Errors were encountered while processing:
linux-image-server
linux-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
由于内核(及其所有相关软件包)是通过包管理器,使用sudo /bin/rm
会导致包管理器的数据库与现实世界脱节。最终你会陷入困惑之中。
我推荐我的答案在这里。用于uname -r
查找当前内核版本号。忽略任何-generic
后缀。请勿删除任何具有此版本号的软件包。请勿删除您当前的内核。
抱歉,我要强调一下,但在这个区域(清理旧操作系统)很容易意外地将您的计算机变成门挡。
答案2
为什么不使用:
apt-get autoremove
apt-get autoclean
每次更新/升级后??? 一段时间以来,它一直运行正常,没有对操作系统造成太大影响,即使 svr 运行多年,并进行了大量更新/升级。我遗漏了什么吗?