内核链接已损坏(不存在未来版本)

内核链接已损坏(不存在未来版本)

我的版本(来自lsb_release -a):

No LSB modules are available.  
Distributor ID: Ubuntu  
Description:    Ubuntu 14.10  
Release:        14.10  
Codename:       utopic  

我想在几乎已满的启动分区中腾出一些空间,因此我输入了:

dpkg -l | grep linux-image-

我检查了我的版本uname -r并得到了3.16.0-29-generic

所以我尝试使用以下方法删除linux-image-3.16.0-24-generic

sudo apt-get autoremove linux-image-3.16.0-24-generic

但是当我这样做时,我收到有关依赖项损坏的错误(由于我的 Ubuntu 是西班牙语的,所以我翻译了,所以消息不完全相同):

Next packages have unsatisfied dependencies:  
 linux-image-extra-3.16.0-24-generic : Depends: linux-image-3.16.0-24-generic but will not be installed  
 linux-image-extra-3.16.0-34-generic : Depends: linux-image-3.16.0-34-generic but will not be installed  
 linux-image-generic : Depends: linux-image-3.16.0-34-generic but will not be installed  
E: Unsatisfied dependencies. Try "apt-get -f install" without packages (or specify a solution).   

注意依赖项 3.16.0-34 的未来版本。

所以我尝试了:

$ sudo apt-get -f install
Next extra packages will be installed:  
  linux-image-3.16.0-34-generic  
Suggested packages:  
  fdutils linux-doc-3.16.0 linux-source-3.16.0 linux-tools  
next NEW packages will be installed:  
  linux-image-3.16.0-34-generic  
0 updated, 1 will be installed, 0 for deletion and 121 not updated.  
8 not installed at all or deleted.  
It will be need to download 0 B/16.2 MB in files.  
45.3 MB of additional disk space will be used after this operation.  
¿You wish to continue? [Y/n]  
(Reading database ... 374202 files or directories currently installed.)  
Preparing to unpack .../linux-image-3.16.0-34-generic_3.16.0-34.45_amd64.deb ...
Done.  
Unpacking linux-image-3.16.0-34-generic (3.16.0-34.45) ...  
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.16.0-34-generic_3.16.0-34.45_amd64.deb (--unpack):  
  could no copy  extracted data from './boot/System.map-3.16.0-34-generic' to '/boot/System.map-3.16.0-34-generic.dpkg-new': unexpected end of file or stream  
dpkg-deb: error: ths cpying subprocess was terminated by signal (Broken pipe)  
Examining /etc/kernel/postrm.d .  
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic  
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic  
Errors found during processing  
 /var/cache/apt/archives/linux-image-3.16.0-34-generic_3.16.0-34.45_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

此时我不确定问题是否是由于我的启动分区几乎已满。我陷入了死锁,因为我无法腾出空间,如果我不安装这种损坏的依赖项,我无法安装它,因为我的启动分区几乎已满。

我怎样才能摆脱以前的内核?我以前也这样做过,没有任何问题。我尝试使用 Synaptic,但结果仍然相同。

答案1

sudo dpkg --remove  --force-remove-reinstreq linux-image-extra-3.16.0-24-generic*  

允许首先删除额外的包,然后:

sudo apt-get autoremove linux-image-3.16.0-24-generic

软件包被删除了。我发现df -h/boot 空间从 98.5% 下降到了 85%,并且我对其他软件包使用了相同的命令。

归功于Zacharee1用于显示--force-remove-reinstreq选项。

相关内容