删除旧版本的内核以释放空间-现在出现不间断错误


10

我的/boot分区已满,因此我删除了旧版本的内核以释放空间,因此我删除了以下文件/boot

abi-3.8.0-25-generic
config-3.8.0-25-generic
initrd.img-3.8.0-25-generic
System.map-3.8.0-25-generic
vmlinuz-3.8.0-25-generic

但是现在,每当我在apt-get中执行任何操作时,它都会引发错误,例如:

sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 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-3.8.0-25-generic (3.8.0-25.37) ...
Internal Error: Could not find image (/boot/vmlinuz-3.8.0-25-generic)
dpkg: error processing linux-image-extra-3.8.0-25-generic (--configure):
subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-extra-3.8.0-25-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

现在我没有备份备份的文件,有什么办法可以解决此问题?

$ dpkg -l linux-image-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                            Version                      Architecture                 Description
+++-===============================================-============================-============================-===================================================================================================
un  linux-image-3.0                                 <none>                                                    (no description available)
rc  linux-image-3.5.0-17-generic                    3.5.0-17.28                  amd64                        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc  linux-image-3.5.0-25-generic                    3.5.0-25.39                  amd64                        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc  linux-image-3.5.0-26-generic                    3.5.0-26.42                  amd64                        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
ii  linux-image-3.5.0-27-generic                    3.5.0-27.46                  amd64                        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc  linux-image-3.8.0-19-generic                    3.8.0-19.30                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-21-generic                    3.8.0-21.32                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-22-generic                    3.8.0-22.33                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-23-generic                    3.8.0-23.34                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-25-generic                    3.8.0-25.37                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-26-generic                    3.8.0-26.38                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-29-generic                    3.8.0-29.42                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-31-generic                    3.8.0-31.46                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-32-generic                    3.8.0-32.47                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
rc  linux-image-extra-3.5.0-17-generic              3.5.0-17.28                  amd64                        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc  linux-image-extra-3.5.0-25-generic              3.5.0-25.39                  amd64                        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc  linux-image-extra-3.5.0-26-generic              3.5.0-26.42                  amd64                        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
ii  linux-image-extra-3.5.0-27-generic              3.5.0-27.46                  amd64                        Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc  linux-image-extra-3.8.0-19-generic              3.8.0-19.30                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-21-generic              3.8.0-21.32                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-22-generic              3.8.0-22.33                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-23-generic              3.8.0-23.34                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
iF  linux-image-extra-3.8.0-25-generic              3.8.0-25.37                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-26-generic              3.8.0-26.38                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-29-generic              3.8.0-29.42                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-31-generic              3.8.0-31.46                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-32-generic              3.8.0-32.47                  amd64                        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-generic                             3.8.0.32.50                  amd64                        Generic Linux kernel image


$ sudo apt-get --reinstall install linux-image-extra-3.8.0-25-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for linux-image-extra-3.8.0-25-generic:amd64

输出是uname -a什么?
Braiam

Answers:


19

程序包管理器抱怨无法删除丢失的文件。所以,给它想要的!我发现即使长度为零的文件也可以。在/ boot中,重新创建丢失的文件:

sudo touch vmlinuz-3.8.0-25-generic

...等。然后只需对所有关联的软件包运行清除:

sudo apt-get purge `apt-cache pkgnames | fgrep 3.8.0-25`

(将要求您确认删除操作)。


2

不要/boot手工删除目录中的任何内容!为此,有包管理器。您应该重新安装软件包以解决这种情况:

sudo apt-get --reinstall install linux-image-extra-3.8.0-25-generic

感谢您的帮助,尽管运气不佳:sudo apt-get --reinstall install linux-image-extra-3.8.0-25-generic阅读软件包列表...完成构建依赖关系树读取状态信息...完成0升级,新安装了0个,重新安装了1个,删除了0个,未升级13个。1未完全安装或卸下。此操作后,将使用0 B的额外磁盘空间。E:内部错误,linux-image-extra-3.8.0-25-generic:amd64没有文件名
Alex

感谢您的帮助,运行更新并将两个命令的输出粘贴到问题中。
亚历克斯
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.