26

Right now I'm upgrading a fairly clean install of 16.04 to 18.04 and it seems to be stuck.

I mean, after some time into the upgrade it went on screen lock and I typed my username and password and it seems to be stuck saying: 'unlocking...'

No idea if this is due to the update still running hogging system resourcing or something else is going on.

I can switch with CtrlAlt+Fkeys but that just gives me black screens and impossible to tell if the upgrade is still running/finished of something terrible happened...

Any idea's? (cant log in with ssh because I haven't installed ssh server on this laptop)

geegee
  • 421
  • 1
  • 4
  • 7
  • now also using alt ctrl + F keys is unresponsive. – geegee Apr 30 '18 at 10:00
  • Have you tried switching to a terminal (ctrl+alt+f4 or your favorite fn key) and logging in there, looking at what's happening (top, iotop etc) – guiverc Apr 30 '18 at 10:07
  • @guiverc as mentioned before, they give me a black screen instead of a login. – geegee Apr 30 '18 at 10:08
  • sorry I didn't know what CTRL+ALT+F did or meant (actually tried the combination on my 18.04 and it did nothing) never realizing you meant Fn keys. – guiverc Apr 30 '18 at 10:09
  • @guiverc i mean the F-keys (F1 - F12) – geegee Apr 30 '18 at 10:11
  • if the HDD light is dead (no disk activity), or appears to be a very predictable pattern and it was mine, I'd wait as long as I could (eg. overnight), use another machine & then force-shutdown using power key and fsck, i may look for update logs (but not be surprised if I didn't find any due poweroff), and then try to continue dist-upgrade. In the meantime (ie. overnight) you may get a better suggestion than this! – guiverc Apr 30 '18 at 10:19
  • unfortunately this laptop does not have a HDD light. its been stuck for a couple of hours so i guess my only option left is to do a powercycle :( – geegee Apr 30 '18 at 11:05
  • Not much help now but the instructions say to turn off inactivity locking during install. I'll remember to put checks in my future wrapper script for upgrading. – WinEunuuchs2Unix Apr 30 '18 at 11:38
  • @WinEunuuchs2Unix i completely missed that when i started the upgrade but good to remember for next time. strikes me as a bit odd that something simple (and important apparently) like that is not handled by the upgrade script itself... or at least advertised in red capitals. – geegee Apr 30 '18 at 11:49
  • I'm also having this issue on a freshly installed system. After the reboot following the install, I can log in fine but once I lock the screen the system is unresponsive. – Kevin Lyda Apr 30 '18 at 12:51
  • @geegee The instructions aren't given in the installation program. They are buried deep on some corner of the Internet. I just read them myself by accident on Sunday. My screens are never set to timeout so it wasn't a problem for me but I imagine it effects a great number of users. As mentioned I'm planning a wrapper script for do-release-upgrade -d to feed it all the Y's and N's necessary for unattended upgrade so I'll see about turning off inactivity lock screen at same time. – WinEunuuchs2Unix Apr 30 '18 at 23:48
  • @WinEunuuchs2Unix great! – geegee May 01 '18 at 13:27

3 Answers3

37

I stumbled into the same issue: Upgrade from 16.04 to 18.04 (on Kubuntu). Screen automatically locked because I didn't use the PC. Entered password, screen is stuck. Switching to the text console - all screens dark. Switching back, mouse courser appears and is responsive, but everything else black.

I then realized:

  1. switching to text console with Ctrl+Alt+F1, the text console was not empty but just very dark. So I increased screen brightness on the laptop with the function keys.

  2. using top I saw that the upgrade probably still running (heavy load on dpkg).

  3. With sudo loginctl unlock-sessions I could unlock the screen savers. I learned this from this answer (full quote for convenience, I used the ):

sudo loginctl unlock-sessions if your system is using systemd. Note that the above will unlock ALL sessions no matter which user is running the screen saver.

If you only want to unlock your own session, just run loginctl unlock-session (no root required because it's your own session).

After that, I changed with Ctrl+Alt+F7 back to KDE and found myself back to the still running session and upgrade process.

Joma
  • 471
  • 7
    I'd give you a thousand upvotes if I could. I absentmindedly locked my screen during my upgrade as I needed to walk away from the computer (at work). Was able to ssh to the machine from another and issue the unlock-sessions command. Thanks!!! – Dashdrum Aug 16 '18 at 13:25
  • 3
    If there is no effect, make sure to add session id to the command sudo loginctl unlock-sessions $SESSION_ID. You can get the list of session ids by running loginctl. – Zheng Qu Mar 04 '20 at 12:57
  • 2
    Thanks for writing this up!

    This still works for upgrading Ubuntu 20.04 to 22.04 as well.

    The virtual console mappings have changed a bit in the last few years: it's CTRL+ALT+F5 to get to the text console, then CTRL+ALT+F2 to get back to UI session.

    – Lance May 29 '22 at 14:01
  • Thanks a lot OP and @ZhengQu ! I would have given you many more upvotes if it were possible :) – mgc Jun 13 '22 at 14:14
5

I am also still having this issue, but I found a workaround - Ctrl+Alt+F1 brings me to the normal login screen where I can enter my password and unlock the desktop. This method keeps the original session, so your browser, terminal and other apps are where you left them.

mtutty
  • 151
  • I installed 18.04 on my laptop on the 4th (2 days ago) and this started happening to me yesterday. I'd already discovered that I can do the same thing (i.e.: pop over to the "switch user" screen) however, that is a bad solution since it doesn't really fix the problem. It does work though! So, yeah, thanks for contributing a workaround. I'm going keep looking for a fix and publish it here as soon as I find it. – Karl Wilbur Jul 06 '18 at 14:29
4

As mentioned in the comments, this problem can happen if your lockscreen is on a timeout. So before upgrading make sure you unset a timeout for lockscreen.

To fix a stuck upgrade: Powerdown the pc/laptop and reboot.

Most likely you will find yourself in a partially upgraded system.

In case if you see black screen on booting up, press Ctrl+Alt+F1 keys combination and it will take you to login prompt from where you can run below commands.

You can fix it with:

sudo dpkg --configure --pending
sudo dpkg --configure -a
sudo apt -f install
sudo apt update
sudo apt upgrade
geegee
  • 421
  • 1
  • 4
  • 7
  • 1
    I think the last two commands should be sudo apt-get update and sudo apt-get upgrade

    Regardless, this had no effect for me.

    – mtutty May 31 '18 at 11:17