Upgrade to Ubuntu 14 freezes

Asked by Michael Heuberger on 2014-04-28

I tried a `do-release-upgrade` from 13.10 to 14.04 today and it failed in the middle :(

There are still files, libraries and modules left from 13.10 and newer files for 14.04 but Ubuntu still says it's version 13.10. At the moment my machine is somewhat in a limbo ...

I always see this message whenever I try to `apt-get update`:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

So, I tried tried `sudo dpkg --configure -a` of course but then it becomes worse. Toward the end I see these lines and then, bang, whole system becomes frozen, unresponsible:

Checking init scripts
Nothing to restart

- BANG! Frozen from here.

Had to cold restart, then tried this over and over again, multiple times. Always the same result. Unable to continue the upgrade to Ubuntu 14.04

Can anybody help me please? I need my machine badly for my work. Thanks!

Here some additional information which might be useful:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"

By the way, when I try a `sudo apt-get -f install` the whole system freezes too at the end.

Warren Hill (warren-hill) said : #2

Easiest is probably a fresh install.

Create a bootable Ubuntu USB and boot from it -- select try Ubuntu

Check everything works as expected

Now assuming it does you can install fresh overwriting the existing install and restore your personal data from your backups

If you don't have any backups you can backup while trying Ubuntu but before you start installing.

Also when I try to open Language Support under Setttings, I get this warning dialog:

Software database is broken

It is impossible to install or remove any software. Please use the package manager "Synaptic" or run "sudo apt-get install -f" in a terminal to fix this issue at first.

Warren, I do not want to do a fresh install and start over again. I worked hard on that machine and have lots of files and directories everywhere I want to keep.

Can't we examine and solve this together? Which log files should I check?

Also, I wonder if there is a way to start the `do-release-upgrade` over again?

Warren Hill (warren-hill) said : #6

Try

sudo apt-get update

If you you get any errors post the results here

If not try

sudo apt-get -f install

again

If you get any errors we will need to know what these are and if it freezes we will need to know how far it got

I tried that before and it crashes too.

But let me do it again for you:
$ sudo apt-get install -f > apt_get_install_f.log

Then it crashed about 15 seconds after pressing Y. Happens everytime I cold-reboot and try again.

And then here the log:

$ cat apt_get_install_f.log
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  libjson0:i386
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  libc-bin
The following packages will be upgraded:
  libc-bin
1 upgraded, 0 newly installed, 0 to remove and 2062 not upgraded.
13 not fully installed or removed.
Need to get 1168 kB of archives.
After this operation, 12.3 kB disk space will be freed.
Do you want to continue [Y/n]? Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libc-bin amd64 2.19-0ubuntu6 [1168 kB]
Fetched 1168 kB in 5s (229 kB/s)
Setting up libc6:amd64 (2.19-0ubuntu6) ...
Generating locales...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... cannot open locale definition file `da_DK': No such file or directory
failed
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
  en_IN.UTF-8... cannot open locale definition file `hi_IN': No such file or directory
failed
  en_NG.UTF-8... cannot open locale definition file `da_DK': No such file or directory
failed
  en_NZ.UTF-8... done
  en_PH.UTF-8... cannot open locale definition file `tl_PH': No such file or directory
failed
  en_SG.UTF-8... done
  en_US.UTF-8... done
  en_ZA.UTF-8... done
  en_ZM.UTF-8... done
  en_ZW.UTF-8... %

BANG! - here it freezes.

There must be a problem with the locales.

Hope the above helps?

Warren Hill (warren-hill) said : #8

Doesn't help me much but there are others reading these questions who may be able to help you further.

This is interesting. I ran

$ sudo dpkg --configure -a > dpkg_configure_a.log 2>&1

and redirecting the stdout to a log file won't crash / freeze the system!

And the output of that log file is:

$ cat dpkg_configure_a.log
dpkg: dependency problems prevent configuration of libc6-dbg:amd64:
 libc6-dbg:amd64 depends on libc6 (= 2.19-0ubuntu6); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-dbg:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-dev:amd64:
 libc6-dev:amd64 depends on libc6 (= 2.19-0ubuntu6); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc-dev-bin:
 libc-dev-bin depends on libc6 (>> 2.19); however:
  Package libc6:amd64 is not configured yet.
 libc-dev-bin depends on libc6 (<< 2.20); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc-dev-bin (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-i386:
 libc6-i386 depends on libc6 (= 2.19-0ubuntu6); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-i386 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-dev-x32:
 libc6-dev-x32 depends on libc6-dev (= 2.19-0ubuntu6); however:
  Package libc6-dev:amd64 is not configured yet.

dpkg: error processing package libc6-dev-x32 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-dev-i386:
 libc6-dev-i386 depends on libc6-i386 (= 2.19-0ubuntu6); however:
  Package libc6-i386 is not configured yet.
 libc6-dev-i386 depends on libc6-dev (= 2.19-0ubuntu6); however:
  Package libc6-dev:amd64 is not configured yet.

dpkg: error processing package libc6-dev-i386 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-x32:
 libc6-x32 depends on libc6 (= 2.19-0ubuntu6); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-x32 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libc6-dbg:amd64
 libc6-dev:amd64
 libc-dev-bin
 libc6-i386
 libc6-dev-x32
 libc6-dev-i386
 libc6-x32

Ok Warren, thanks.

Yes, I hope others can help. Please ...

sudo apt-get --reinstall install libc6-dev:amd64 libc6-dev-x32 libc6-dev-i386

What is the output please

No success Andrew :(

$ sudo apt-get --reinstall install libc6-dev:amd64 libc6-dev-x32
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

$ sudo dpkg --audit
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
 libc6-dbg:amd64 Embedded GNU C Library: detached debugging symbols
 libc6-dev:amd64 Embedded GNU C Library: Development Libraries and Header
 libc-dev-bin Embedded GNU C Library: Development binaries
 libc6-i386 Embedded GNU C Library: 32-bit shared libraries for AMD64
 libc6-dev-x32 Embedded GNU C Library: X32 ABI Development Libraries for
 libgcc1:i386 GCC support library
 libc6-dev-i386 Embedded GNU C Library: 32-bit development libraries for
 libc6-x32 Embedded GNU C Library: X32 ABI Shared libraries for AMD6
 sysvinit-utils System-V-like utilities
 libcap2:amd64 support for getting/setting POSIX.1e capabilities
 libcap2:i386 support for getting/setting POSIX.1e capabilities

The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 libc6:amd64 Embedded GNU C Library: Shared libraries
 libc6:i386 Embedded GNU C Library: Shared libraries

I digged deeper with whoopsie's log and think this is relevant:

$ sudo cat _usr_share_apport_apport-gtk.1001.crash
[sudo] password for michael.heuberger:
ProblemType: Crash
Date: Tue Apr 29 01:28:54 2014
ExecutablePath: /usr/share/apport/apport-gtk
ExecutableTimestamp: 1386693790
InterpreterPath: /usr/bin/python3.3
ProcCmdline: /usr/bin/python3 /usr/share/apport/apport-gtk
ProcCwd: /home/tester
ProcEnviron:
 LANGUAGE=en_NZ:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_NZ.UTF-8
 SHELL=/bin/bash
ProcMaps:
 00400000-00726000 r-xp 00000000 08:12 2886529 /usr/bin/python3.3
 00925000-00926000 r--p 00325000 08:12 2886529 /usr/bin/python3.3
 00926000-009bf000 rw-p 00326000 08:12 2886529 /usr/bin/python3.3
 009bf000-009db000 rw-p 00000000 00:00 0

... more lines like these removed ...

 7fff3d51d000-7fff3d51f000 r-xp 00000000 00:00 0 [vdso]
 ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
ProcStatus:
 Name: apport-gtk
 State: R (running)
 Tgid: 15801
 Pid: 15801
 PPid: 15799
 TracerPid: 0
 Uid: 1001 1001 1001 1001
 Gid: 1001 1001 1001 1001
 FDSize: 64
 Groups: 1001
 VmPeak: 374080 kB
 VmSize: 354524 kB
 VmLck: 0 kB
 VmPin: 0 kB
 VmHWM: 30024 kB
 VmRSS: 30024 kB
 VmData: 163328 kB
 VmStk: 136 kB
 VmExe: 3224 kB
 VmLib: 24452 kB
 VmPTE: 436 kB
 VmSwap: 0 kB
 Threads: 3
 SigQ: 0/47519
 SigPnd: 0000000000000000
 ShdPnd: 0000000000000000
 SigBlk: 0000000000000000
 SigIgn: 0000000001001000
 SigCgt: 0000000180000002
 CapInh: 0000000000000000
 CapPrm: 0000000000000000
 CapEff: 0000000000000000
 CapBnd: 0000001fffffffff
 Seccomp: 0
 Cpus_allowed: ffff
 Cpus_allowed_list: 0-15
 Mems_allowed: 00000000,00000001
 Mems_allowed_list: 0
 voluntary_ctxt_switches: 102
 nonvoluntary_ctxt_switches: 27
PythonArgs: ['/usr/share/apport/apport-gtk']
Traceback:
 Traceback (most recent call last):
   File "/usr/share/apport/apport-gtk", line 590, in <module>
     app.run_argv()
   File "/usr/lib/python3/dist-packages/apport/ui.py", line 685, in run_argv
     return self.run_crashes()
   File "/usr/lib/python3/dist-packages/apport/ui.py", line 215, in run_crashes
     if not self.load_report(f):
   File "/usr/lib/python3/dist-packages/apport/ui.py", line 1248, in load_report
     self.cur_package = apport.fileutils.find_file_package(self.report.get('ExecutablePath', ''))
   File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 100, in find_file_package
     return packaging.get_file_package(file)
   File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 341, in get_file_package
     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
   File "/usr/lib/python3.3/subprocess.py", line 824, in __init__
     restore_signals, start_new_session)
   File "/usr/lib/python3.3/subprocess.py", line 1448, in _execute_child
     raise child_exception_type(errno_num, err_msg)
 FileNotFoundError: [Errno 2] No such file or directory: '/usr/sbin/dpkg-divert'
UserGroups:

Looks like that FileNotFoundError made the whole system crash.

And this is interesting too:

$ sudo tail _usr_bin_software-properties-gtk.1001.crash
   File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 98, in __init__
     SoftwareProperties.__init__(self, options=options, datadir=datadir)
   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
     self.reload_sourceslist()
   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
     self.distro.get_sources(self.sourceslist)
   File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources
     (self.id, self.codename))
 aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Ubuntu/trusty
UserGroups:

This NoDistroTemplateException also might have caused the crash ...

Okay, I digged further and opened that file where it crashes:

$ sudo vi /usr/lib/python3/dist-packages/aptsources/distro.py

        # find the distro template
        for template in self.sourceslist.matcher.templates:
            if (self.is_codename(template.name) and
                template.distribution == self.id):
                #print "yeah! found a template for %s" % self.description
                #print template.description, template.base_uri, \
                # template.components
                self.source_template = template
                break
        if self.source_template is None:
            raise NoDistroTemplateException(
                "Error: could not find a distribution template for %s/%s" %
                (self.id, self.codename))

Somehow it does not find the distro template in the for-loop. But my sources.list and lsb-release already have been switched to trusty. Weird.

Theor (theor) said : #19

Not sure if this helps, but have you tried running a "sudo apt-get upgrade -m && apt-get dist-upgrade -m"?

Thanks but no success:

$ sudo apt-get upgrade -m
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

$ sudo apt-get dist-upgrade -m
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

There is no way around dpkg!

@Theor, the archives are locatable, no need for the -m parameter. All archives are successfully downloaded into the apt-get cache. Just dpkg fails big time in the middle!

I ran dpkg in debug mode with -D777 and found out that it's crashing when processing the file

/var/lib/dpkg/info/libselinux1:amd64.postinst

It is interesting. Have a look at its contents:

---
$ cat libselinux1:amd64.postinst
#!/bin/sh

set -e

if [ "$1" = "configure" ]; then
 # Restart init. If it fails, there is nothing we can do, so
 # just ignore the error (NOTE: Borrowed from libc6.postinst)
 telinit u 2>/dev/null || true ; sleep 1
fi

# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
 ldconfig
fi
# End automatically added section

exit 0
---

Looks like "telinit u 2>/dev/null || true ; sleep 1" is the bad part, freezing the whole system.

David Oftedal (rounin) said : #23

This is a known bug, I believe:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1271440

Workaround in point 1) of this comment:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1269731/comments/32 .

My umbrella bug where I track all of the crash bugs related to "telinit u" that I've found:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1303139

As I understand the situation, the developers have marked these bugs as "Fix released" and moved un, but as the users upgrading are still on older versions, it keeps affecting people.

James Hunt (jamesodhunt) said : #24

MIchael - please follow the instructions below to work around this issue:

https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1269405/comments/30

Once you've done this, please raise a bug on Upstart by running:

ubuntu-bug upstart

This will attach the relevant information to the bug to allow us to investigate the issue you are seeing.

Sorry guys but I could not wait any longer and reinstalled my machine :(

I needed it for work and waited for days for your help. But thanks anyway ...

Can you help with this problem?

Provide an answer of your own, or ask Michael Heuberger for more information if necessary.

To post a message you must log in.