我从 ssh 会话运行:
sudo apt-get install update-manager-core
sudo do-release-upgrade
我去读了其他东西,当我返回 ssh 会话时,它没有响应。我猜我的路由器断开了连接。我尝试重新 ssh 登录,并成功登录。我不记得接下来发生了什么,但无论如何我重启了机器。我认为这不是最好的主意,因为我无法再次登录。
在查看了这个问题之后,我偶然发现了这问题:
我启动了救援模式并且:
mkdir -p /mnt/rescue
mount /dev/xvda /mnt/rescue
chroot /mnt/rescue /bin/bash
dpkg --configure -a
这似乎让我回到了最初会话结束的地方。然后我重新启动,但仍然无法正常登录。
后来我读到我应该:
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get update
sudo apt-get upgrade
在救援模式下我做了上述操作,但现在我看到的是:
0 upgraded, 0 newly installed, 0 to remove and 248 not upgraded.
9 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up cron (3.0pl1-124ubuntu2) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection re
fused
runlevel:/var/run/utmp: No such file or directory
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection re
fused
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refu
sed
invoke-rc.d: initscript cron, action "start" failed.
dpkg: error processing package cron (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up udev (204-5ubuntu20.10) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection re
fused
runlevel:/var/run/utmp: No such file or directory
* udev requires a mounted procfs, not started
...fail!
invoke-rc.d: initscript udev, action "restart" failed.
dpkg: error processing package udev (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of initramfs-tools:
initramfs-tools depends on udev (>= 147~-5); however:
Package udev is not configured yet.
dpkg: error processing package initramfs-tools (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dmsetup:
dmsetup depends on initramfs-tools; however:
Package initramfs-tools is not configured yet.
dmsetup depends on udev (>> 141-2); however:
Package udev is not configured yet.
..还有更多看起来非常相似但针对不同包的错误。
最后结束于:
Errors were encountered while processing:
cron
udev
initramfs-tools
dmsetup
console-setup
kbd
plymouth
postfix
mailutils
E: Sub-process /usr/bin/dpkg returned an error code (1)
当我通过 Lish 登录时,我得到:
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
md: ... autorun DONE.
EXT3-fs: barriers not enabled
kjournald starting. Commit interval 5 seconds
EXT3-fs (xvda): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) readonly on device 202:0.
devtmpfs: mounted
Freeing unused kernel memory: 860K (ffffffff81c97000 - ffffffff81d6e000)
Write protecting the kernel read-only data: 12288k
Freeing unused kernel memory: 48K (ffff8800017f4000 - ffff880001800000)
Freeing unused kernel memory: 1056K (ffff880001af8000 - ffff880001c00000)
Mount failed for selinuxfs on /sys/fs/selinux: No such file or directory
random: init urandom read with 36 bits of entropy available
我现在很困惑。有什么想法吗?谢谢。