1

I had apt-get autoremove turned on in order to keep clean. After that when I used apt-get install to install a package, it first tried to uninstall the old linux kernel files on my computer, then output a lot of errors, the session output is here:

sudo apt-get install dconf-editor
正在读取软件包列表... 完成
下列软件包将被【卸载】:
  linux-image-extra-3.13.0-65-generic linux-image-extra-3.13.0-68-generic
  linux-image-extra-3.13.0-70-generic linux-image-extra-3.13.0-71-generic
  linux-image-extra-3.13.0-73-generic linux-image-extra-3.13.0-74-generic
  linux-image-extra-3.13.0-79-generic linux-image-extra-3.13.0-83-generic
  linux-image-extra-3.13.0-85-generic linux-image-extra-3.13.0-86-generic
  linux-image-extra-3.13.0-95-generic linux-image-extra-3.13.0-96-generic
  linux-image-extra-3.13.0-98-generic
下列【新】软件包将被安装:
  dconf-editor
升级了 0 个软件包,新安装了 1 个软件包,要卸载 13 个软件包,有 356 个软件包未被升级。
有 16 个软件包没有被完全安装或卸载。
需要下载 0 B/100 kB 的软件包。
解压缩后将会空出 1,975 MB 的空间。
您希望继续执行吗? [Y/n] y
正在卸载 linux-image-extra-3.13.0-65-generic (3.13.0-65.106) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-65-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-65-generic
grep: /boot/config-3.13.0-65-generic: 没有那个文件或目录
depmod: WARNING: could not open /tmp/mkinitramfs_v3e1AB/lib/modules/3.13.0-65-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_v3e1AB/lib/modules/3.13.0-65-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic
run-parts: executing /etc/kernel/postinst.d/zz-runlilo 3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic
Added Linux  +  *
Fatal: open /boot/vmlinuz-3.13.0-103-generic: No such file or directory
run-parts: /etc/kernel/postinst.d/zz-runlilo exited with return code 1
dpkg: 处理软件包 linux-image-extra-3.13.0-65-generic (--remove)时出错:
 子进程 已安装 post-removal 脚本 返回了错误号 1
正在卸载 linux-image-extra-3.13.0-68-generic (3.13.0-68.111) ...
    ...
正在卸载 linux-image-extra-3.13.0-70-generic (3.13.0-70.113) ...
    ...
    ...
在处理时有错误发生:
 linux-image-extra-3.13.0-65-generic
 linux-image-extra-3.13.0-68-generic
 linux-image-extra-3.13.0-70-generic
 linux-image-extra-3.13.0-71-generic
 linux-image-extra-3.13.0-73-generic
 linux-image-extra-3.13.0-74-generic
 linux-image-extra-3.13.0-79-generic
 linux-image-extra-3.13.0-83-generic
 linux-image-extra-3.13.0-85-generic
 linux-image-extra-3.13.0-86-generic
 linux-image-extra-3.13.0-95-generic
 linux-image-extra-3.13.0-96-generic
 linux-image-extra-3.13.0-98-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

and the package I requested could not be installed. Here is the apt's log:

Start-Date: 2017-03-13  19:00:09
Commandline: apt-get install dconf-editor
Install: dconf-editor:amd64 (0.20.0-1)
Remove: linux-image-extra-3.13.0-85-generic:amd64 (3.13.0-85.129), linux-image-extra-3.13.0-65-generic:amd64 (3.13.0-65.106), linux-image-extra-3.13.0-74-generic:amd64 (3.13.0-74.118), linux-image-extra-3.13.0-83-generic:amd64 (3.13.0-83.127), linux-image-extra-3.13.0-70-generic:amd64 (3.13.0-70.113), linux-image-extra-3.13.0-79-generic:amd64 (3.13.0-79.123), linux-image-extra-3.13.0-68-generic:amd64 (3.13.0-68.111), linux-image-extra-3.13.0-86-generic:amd64 (3.13.0-86.131), linux-image-extra-3.13.0-95-generic:amd64 (3.13.0-95.142), linux-image-extra-3.13.0-73-generic:amd64 (3.13.0-73.116), linux-image-extra-3.13.0-71-generic:amd64 (3.13.0-71.114), linux-image-extra-3.13.0-98-generic:amd64 (3.13.0-98.145), linux-image-extra-3.13.0-96-generic:amd64 (3.13.0-96.143)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2017-03-13  19:06:41

My kernel is 3.13.0-105-generic, I had tried to disable the autoremove by adding the apt.conf file in /etc/apt:

~/temp$ cat /etc/apt/apt.conf
APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";

but it didn't work. So how can I fix this problem ?

  • Please edit your question to show us the complete output of a failed apt session. The current abridged version does not contain enough information to help you. – user535733 Mar 12 '17 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.