6

Today several attempts at upgrading from Ubuntu 16.04 LTS to 18.04 LTS failed. I attempted this using both the Software Updater program and the command line. Here is the output from the command-line (trimming 'http:' to 'ttp:'):

$ sudo do-release-upgrade -d
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [819 B]                                           
Get:2 Upgrade tool [1,258 kB]                                                  
Fetched 1,259 kB in 0s (0 B/s)                                                 
authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg' 
extracting 'bionic.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Hit ttp://us.archive.ubuntu.com/ubuntu xenial InRelease                       
Hit ttp://us.archive.ubuntu.com/ubuntu xenial-updates InRelease               
Hit ttp://us.archive.ubuntu.com/ubuntu xenial-backports InRelease             
Ign ttp://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease        
Ign ttp://dl.google.com/linux/chrome/deb stable InRelease                     
Hit ttp://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release          
Get:1 ttp://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]     
Ign ttp://dl.google.com/linux/talkplugin/deb stable InRelease                 
Hit ttp://dl.google.com/linux/chrome/deb stable Release                       
Hit ttp://dl.google.com/linux/talkplugin/deb stable Release                   
Hit https://repo.skype.com/deb stable InRelease                                
Ign https://storage.googleapis.com/download.dartlang.org/linux/debian stable InRelease
Hit https://download.virtualbox.org/virtualbox/debian xenial InRelease         
Ign https://storage.googleapis.com/download.dartlang.org/linux/debian unstable InRelease
Hit https://storage.googleapis.com/download.dartlang.org/linux/debian stable Release
Hit https://storage.googleapis.com/download.dartlang.org/linux/debian unstable Release
Hit https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease    
Fetched 107 kB in 0s (0 B/s)                                                   

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

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

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

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

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

(appstreamcli:22168): 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
  Hold prevents MarkGarbage of libnl-route-3-200 [ amd64 ] < 3.2.21-1 -> 3.2.27-1ubuntu0.16.04.1 > ( libs )
  Hold prevents MarkGarbage of libnl-route-3-200 [ amd64 ] < 3.2.21-1 -> 3.2.27-1ubuntu0.16.04.1 > ( libs )

Updating repository information

Third party sources disabled 

Some third party entries in your sources.list were disabled. You can 
re-enable them after the upgrade with the 'software-properties' tool 
or your package manager. 

To continue please press [ENTER]

Hit ttp://us.archive.ubuntu.com/ubuntu bionic InRelease                                               
Hit ttp://us.archive.ubuntu.com/ubuntu bionic-updates InRelease                                       
Hit ttp://us.archive.ubuntu.com/ubuntu bionic-backports InRelease                                     
Get:1 ttp://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]                            
Fetched 83.2 kB in 0s (0 B/s)                                                                          
The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources
Can't call method "policy" on an undefined value at /usr/bin/apt-show-versions line 56.
Hit ttp://security.ubuntu.com/ubuntu bionic-security InRelease                                        
Hit ttp://us.archive.ubuntu.com/ubuntu bionic InRelease                                               
Hit ttp://us.archive.ubuntu.com/ubuntu bionic-updates InRelease                                       
Hit ttp://us.archive.ubuntu.com/ubuntu bionic-backports InRelease                                     
Fetched 0 B in 0s (0 B/s)                                                                              
The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources
Can't call method "policy" on an undefined value at /usr/bin/apt-show-versions line 56.
Hit ttp://us.archive.ubuntu.com/ubuntu bionic InRelease                                               
Hit ttp://us.archive.ubuntu.com/ubuntu bionic-updates InRelease                                       
Hit ttp://us.archive.ubuntu.com/ubuntu bionic-backports InRelease                                     
Get:1 ttp://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]                            
Fetched 83.2 kB in 0s (0 B/s)                                                                          
The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources
Can't call method "policy" on an undefined value at /usr/bin/apt-show-versions line 56.

Error during update 

A problem occurred during the update. This is usually some sort of 
network problem, please check your network connection and retry. 

E:Problem executing scripts APT::Update::Post-Invoke-Success 'test -x 
/usr/bin/apt-show-versions || exit 0 ; apt-show-versions -i', 
E:Sub-process returned an error code 


Restoring original system state

Aborting
Reading package lists... Done    
Building dependency tree          
Reading state information... Done
  Hold prevents MarkGarbage of libnl-route-3-200 [ amd64 ] < 3.2.21-1 -> 3.2.27-1ubuntu0.16.04.1 > ( libs )
  Hold prevents MarkGarbage of libnl-route-3-200 [ amd64 ] < 3.2.21-1 -> 3.2.27-1ubuntu0.16.04.1 > ( libs )

Comments:

I have previously successfully upgraded this machine from 14.04 to 16.04. So I am not unfamiliar with the process.

The following failure message appeared when using both the Software Updater and the command line:

Error during update 

A problem occurred during the update. This is usually some sort of 
network problem, please check your network connection and retry. 

E:Problem executing scripts APT::Update::Post-Invoke-Success 'test -x 
/usr/bin/apt-show-versions || exit 0 ; apt-show-versions -i', 
E:Sub-process returned an error code

Before attempting the upgrade, I successfully invoked sudo apt-get update several times today, so I don't think I have a network connection problem.

In the output above, the following message appears to be significant, as it appears three times:

The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources
Can't call method "policy" on an undefined value at /usr/bin/apt-show-versions line 56.

This is the only place I could locate the string 'APT::Default-Release':

$ cat /etc/apt/apt.conf
APT::Default-Release "stable";

apt-show-versions is a Perl program. If I copy that program to a scratch directory and run it as my own user using the /usr/bin/perl, the program completes successfully and without error output. It does not throw an exception at these lines:

55 my $cache = AptPkg::Cache->new;
56 my $policy = $cache->policy;

Can anyone diagnose?

Thank you very much.

Jim Keenan

  • what happens if you edit /etc/apt/apt.conf and change it to * ? – Joshua Besneatte Sep 1 '18 at 16:05
  • Or how about....a clean install. When I upgraded I got to 18.04. Only trouble was the audio no longer worked, whereas a clean install produced no issues to speak of. Also the upgrade took about 80 mins whereas a clean install took about 15 mins. – Paul Benson Sep 1 '18 at 16:20
5

I think what you need to do, according to this thread is edit your apt.conf file:

sudo nano /etc/apt/apt.conf

And change the contents to this:

APT::Default-Release *;
  • 1
    I have implemented your suggestion and re-run sudo do-release-upgrade -d. The upgrade got past the previous failure point. I will report further when the process has concluded. Thank you very much. – James E Keenan Sep 1 '18 at 17:00
  • 1
    Joshua Besneatte's suggestion was correct. This enabled do-release-upgrade to proceed. (The upgrade to 18.04 subsequently went incredibly astray, but that's for a different thread.) – James E Keenan Sep 7 '18 at 13:42
  • please be sure to accept the answer by clicking the checkbox under the voting arrows on the left side of hte answer. thanks! – Joshua Besneatte Sep 7 '18 at 14:22
  • I had a different problem which was that my /etc/apt/apt.conf was a directory instead of a file, which was causing do-release-upgrade to hang indefinitely at the "Reading cache" step with 100% CPU usage. A sudo rmdir /etc/apt/apt.conf fixed my issue. Thanks for the hint! – PolyTekPatrick May 31 at 13:02
  • If upgrade completes successfully, but you still see those messages about HWE/16.04>18.04, check here: askubuntu.com/a/1036237/169878 – bshea Sep 7 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.