如何从 14.04 上的 do-release-upgrade 失败中恢复?

如何从 14.04 上的 do-release-upgrade 失败中恢复?

我在从 trusty 到 wiley 的升级过程中断电了。我使用实时 USB 启动并运行了以下命令:

sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /boot /mnt/boot
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
sudo apt-get dist-upgrade

并得到:

root@lubuntu:/# sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)
Setting up linux-image-4.2.0-36-generic (4.2.0-36.42) ...
Internal Error: Could not find image (/boot/vmlinuz-4.2.0-36-generic)
dpkg: error processing package linux-image-4.2.0-36-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.2.0-36-generic:
 linux-image-extra-4.2.0-36-generic depends on linux-image-4.2.0-36-generic; however:
  Package linux-image-4.2.0-36-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.2.0-36-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-4.2.0-36-generic; however:
  Package linux-image-4.2.0-36-generic is not configured yet.
 linux-image-generic depends on linux-image-extra-4.2.0-36-generic; however:
  Package linux-image-extra-4.2.0-36-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 4.2.0.36.39); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
Errors were encountered while processing:
 linux-image-4.2.0-36-generic
 linux-image-extra-4.2.0-36-generic
 linux-image-generic
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

我该如何修复这个问题?

答案1

我能够从 grub 的高级菜单中启动最旧的内核。运行 apt-get install -f 进行修复,然后重新启动进入新内核,一切正常。

相关内容