Can't log in after update
sudo apt-get install update-manager-core
sudo do-release-upgrade
I went to read something else and when I returned to my ssh session, it wasn't responsive. I'm presuming my router dropped the connection. I tried to ssh back in, and managed to log in. I can't remember exactly what happened next, but either way I rebooted the machine. I don't think this was the best idea, as I couldn't log back in again.
After looking up the problem, I came across this question:
I booted into rescue mode and:
mkdir -p /mnt/rescue
mount /dev/xvda /mnt/rescue
chroot /mnt/rescue /bin/bash
dpkg --configure -a
This seemed to take be back to where my initial session ended. I then rebooted, but it still couldn't log in normally.
I later read that I should:
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get update
sudo apt-get upgrade
In rescue mode I did the above, but now I'm presented with:
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.
..and a more erros that look very similar but for different packages.
Finally it ends with:
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)
When I login via Lish I get:
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
I'm stumped now. Any ideas? Thank you.
1 Reply
mkdir -p /mnt/rescue
mount /dev/xvda /mnt/rescue
chroot /mnt/rescue /bin/bash
Try this
mkdir -p /mnt/rescue
mount /dev/xvda /mnt/rescue
mount -o bind /proc /mnt/rescue/proc
mount -o bind /sys /mnt/rescue/sys
mount -o bind /dev /mnt/rescue/dev
chroot /mnt/rescue /bin/bash
````
Then try running the apt/dpkg commands again.