Ubuntu upgrade from 16.04 to 18.04 is taking too long

I'm upgrading Ubuntu on a new laptop , 16.04 to 18.04, following instructions here.

The last command I ran was:

sudo do-release-upgrade -d

Now I'm stuck on

To continue please press [ENTER]

Inhibiting until Ctrl+C is pressed...

I can't say exactly, but I started upgrading about three hours ago. It seems to me that the upgrade is taking too long. I also noticed that I have no network activity in System Monitor, and the Total Received number is less than the upgrade download size (which is 1 189 M).

Is this possible to check my upgrade status? May the System Monitor received size not taking into account any traffic?

UPDATE

I canceled the process and I saw that there's actually an error.

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

So I looked for the process that was blocking it

sudo lsof /var/lib/dpkg/lock

It happened to be aptd. I checked its pid

ps -e | grep aptd

and killed it

sudo kill -9 14806

After that I was able to run (as @Jos suggested):

sudo apt install -f

And started the upgrade process from the beginning.


Solution 1:

I got the same message. Pressing Enter got it going. Not sure what the message means, but pressing Enter did the upgrade from there.

Solution 2:

I just had the same. How I fixed it:

  1. cp /etc/apt/source.list.distUpgrade
  2. apt update
  3. sudo do-release-upgrade

It then should start installing again. Do not press Ctrl+C, but just hit [ENTER]

Solution 3:

Your update process ought to give you a complete log of what is being downloaded, unpacked, installed and configured. If it doesn't, there is something wrong, but at this point we can only speculate what. However, you can simply interrupt the upgrade with Ctrl + C. Then do sudo apt install -f to see where you were.

One thing may have gone wrong though. If the upgrade process was running, then early on your Ubuntu version string was changed (in your case from xenial to bionic) in /etc/apt/sources.list. You may need to change that back before retrying the upgrade.