Dist-upgrade seems to have created an issue

6,116

I had the same problem after running sudo do-release-upgrade -d on a Ubuntu 16.04 cloned partition. The intent was to test for bugs in upgrade to 18.04.1 but the system stalled with message:

To continue please press [ENTER]
Inhibiting until Ctrl+C is pressed...

So I pressed Ctrl+C and it returned to command prompt.

Next I ran:

$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://ca.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://ca.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://ca.archive.ubuntu.com/ubuntu bionic-backports InRelease
                             
(appstreamcli:15814): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed

(appstreamcli:15814): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed

(appstreamcli:15814): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed

(appstreamcli:15814): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed
AppStream cache update completed, but some metadata was ignored due to errors.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
1675 packages can be upgraded. Run 'apt list --upgradable' to see them.

Based on comments above plus this answer: Hit Ctrl+c during do-release-upgrade. Did I break it? I used:

sudo sed -i -e 's/bionic/xenial/g' /etc/apt/sources.list

Now sudo apt update completes normally.

Problems with upgrade

Now when I run do-release-upgrade -d and pay close attention I notice these lines in the middle:

Get:57 http://ca.archive.ubuntu.com/ubuntu bionic-backports/universe DEP-11 64x64 Icons [1,789 B]
Fetched 44.8 MB in 6s (4,884 kB/s)                                                         

(appstreamcli:30117): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed

(appstreamcli:30117): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed

(appstreamcli:30117): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed

(appstreamcli:30117): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed
AppStream cache update completed, but some metadata was ignored due to errors.

Checking package manager
Reading package lists... Done    

I abort the upgrade by answering N to prompt.

A quick search leads to this Question & Answer: E: Problem executing scripts APT Update::Post-Invoke-Success error during apt-get update

I can verify the same situation using:

$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://ca.archive.ubuntu.com/ubuntu xenial InRelease                                 
Hit:3 http://ca.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://ca.archive.ubuntu.com/ubuntu xenial-backports InRelease
AppStream cache update completed, but some metadata was ignored due to errors.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

The recommended solution in the link is to use:

sudo apt-get purge libappstream3

Running this the meta error is now gone:

$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://ca.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://ca.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://ca.archive.ubuntu.com/ubuntu xenial-backports InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

Next step will be to run sudo do-release-upgrade -d a third time and cross my fingers.

Misleading message during upgrade

Another user had similar problem: Ubuntu upgrade from 16.04 to 18.04 is taking too long

Turns out the two line message comes out at the same time:

To continue please press [ENTER]
Inhibiting until Ctrl+C is pressed...

You think the upgrade is inhibited until you press Ctrl+C but what it really means is the upgrade doesn't start until you press Enter.

sigh

Share:
6,116

Related videos on Youtube

Rattle
Author by

Rattle

Just an average linux noob. Learning step by step

Updated on September 18, 2022

Comments

  • Rattle
    Rattle over 1 year

    If I remember correctly I used sudo apt-get dist-upgrade, but I cancelled the process in between. I received a (Y/N) prompt for upgrading towards the end and typed N.

    After this I've been having some issues like this upon running apt-get update

    The interesting thing is that I am actually running 16.04.

    Distributor ID: Ubuntu
    Description:    Ubuntu 16.04.4 LTS
    Release:    16.04
    Codename:   xenial
    

    But somehow apt-get looks for artful packages instead of those for xenial.

    Get:25 http://archive.ubuntu.com/ubuntu artful-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
    Get:26 http://archive.ubuntu.com/ubuntu artful-backports/universe amd64 DEP-11 Metadata [5,088 B]
    Fetched 1,592 kB in 5s (283 kB/s)              
    
    (appstreamcli:8437): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed
    
    (appstreamcli:8437): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed
    

    Edit: This is how my /etc/apt/sources.list looks

    Messed up /apt/sources.list

    I replaced artful with xenial everywhere and the issue seems to have been resolved.

    • guiverc
      guiverc about 6 years
      I can't see how a dist-upgrade could possibly do this. The file that contains where to grab updates from (and what you see on screen during the commands) is /etc/apt/sources.list which you've I'm guessing edited, or run a script that edited it (changing maybe the xenial references to artful in that file). This would have to occur before a dist-upgrade could grab wrong packages. Or you've manually download & dpkg -i installed a later file (and ignored the warnings to force it). You need to get the artful references out, see what you've installed (from artful) & back it out.
    • Rattle
      Rattle about 6 years
      @guiverc I haven't touched the sources.list file.
    • guiverc
      guiverc about 6 years
      Once you've fixed your sources.list (and any mucked up in sources.list.d/ you are going to need to scan for what packages were installed from artful & remove them (replacing with xenial ones). A faster solution may be to just jump to bionic (18.04).
    • guiverc
      guiverc about 6 years
      try entering grep artful /etc/apt/sources.list which should result in 0 lines of output. I suspect you'll have some. (the alternative is you've added a non-Canonical repo, PPA that caused the addition. these may not show up in sources.list, but in files within sources.list.d/ thru grep artful /etc/apt/sources.list.d/* )
    • Rattle
      Rattle about 6 years
      okay, @guiverc, I only see artful references now, I guess I need to replace them with xenial ones, but which ones are the correct ones? Is there a list somewhere?
    • Rattle
      Rattle about 6 years
      okay, I just replaced artful with xenial, works now