Issues after update 16.04 - 18.04 LTS
https://askubuntu.com/questions/1095422/issues-after-update-16-04-18-04-lts
I recently tried upgrading my HP Z420 workstation from Ubuntu 16.04 to 18.04. While updating, Ubuntu froze at the instance shown.
[user@hostname]:~$ sudo apt-get update; sudo update-manager -d
Ign:1 http://dl.google.com/linux/chrome-remote-desktop/deb stable InRelease
Hit:2 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial InRelease
Hit:3 http://lu.archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://lu.archive.ubuntu.com/ubuntu xenial-updates InRelease
Ign:5 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:6 http://dl.google.com/linux/chrome-remote-desktop/deb stable Release
Hit:7 http://lu.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:8 http://dl.google.com/linux/chrome/deb stable Release
Get:9 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:10 https://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease
Hit:11 https://download.sublimetext.com apt/dev/ InRelease
Fetched 107 kB in 0s (151 kB/s)
AppStream cache update completed, but some metadata was ignored due to errors.
Reading package lists... Done
/usr/bin/update-manager:28: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk
/usr/lib/python3/dist-packages/UpdateManager/UnitySupport.py:29: PyGIWarning: Dbusmenu was imported without specifying a version first. Use gi.require_version('Dbusmenu', '0.4') before import to ensure that the right version gets loaded.
from gi.repository import Dbusmenu, Unity
/usr/lib/python3/dist-packages/UpdateManager/UnitySupport.py:29: PyGIWarning: Unity was imported without specifying a version first. Use gi.require_version('Unity', '7.0') before import to ensure that the right version gets loaded.
from gi.repository import Dbusmenu, Unity
Checking for a new Ubuntu release
/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeFetcher.py:23: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, Gdk
/usr/lib/python3/dist-packages/DistUpgrade/ReleaseNotesViewerWebkit.py:33: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded.
from gi.repository import WebKit2 as WebKit
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg'
extracting 'bionic.tar.gz'
(appstreamcli:7885): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed
(appstreamcli:7885): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed
(appstreamcli:7885): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed
(appstreamcli:7885): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed
(appstreamcli:7885): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed
(appstreamcli:7885): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed
AppStream cache update completed, but some metadata was ignored due to errors.
MarkInstall libc6 [ amd64 ] < 2.23-0ubuntu10 -> 2.27-3ubuntu1 > ( libs ) FU=1
MarkInstall locales [ amd64 ] < 2.23-0ubuntu10 -> 2.27-3ubuntu1 > ( libs ) FU=0
Installing libc-bin as Depends of locales
MarkInstall libc-bin [ amd64 ] < 2.23-0ubuntu10 -> 2.27-3ubuntu1 > ( libs ) FU=0
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
(bionic:7134): Pango-WARNING **: failed to create cairo scaled font, expect ugly output. the offending font is 'Ubuntu Bold 13.1982421875'
(bionic:7134): Pango-WARNING **: font_face status is: file not found
(bionic:7134): Pango-WARNING **: scaled_font status is: file not found
(bionic:7134): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='PangoFcShapeEngine', font='Ubuntu Bold 13.1982421875', text='Upgrading Ubuntu to version 18.04'
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/libgvc6-plugins-gtk.0.crash'
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/fontconfig.0.crash'
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/fontconfig.0.crash'
I then rebooted after which I consistently got a kernel panic, as shown.
[ 0.787089] Kernel panic - not syncing: VFS: Unable to mount root fs
on unknown-block(0,0)
[ 0.787149] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.15.0-39-generic #42-U
buntu
[ 0.787201] Hardware name: Hewlett-Packard HP Z420 Workstation/1589, BIOS J61
v02.55 02/07/2013
[ 0.787257] Call Trace:
[ 0.787303] dump_stack+0x63/0x8b
[ 0.787352] panic+0xe4/0x244
[ 0.787398] mount_block_root+0x1f6/0x2da
[ 0.787442] ? set_debug_rodata+0x17/0x17
[ 0.787486] mount_root+0x38/0x3a
[ 0.787527] prepare_namespace+0x139/0x18e
[ 0.787571] kernel_init_freeable+0x224/0x251
[ 0.787625] ? rest_init+0xb0/0xb0
[ 0.787668] kernel_init+0xe/0x110
[ 0.787722] ret_from_fork+0x35/0x40
[ 0.787798] Kernel Offset: 0x21800000 from 0xffffffff81000000 (relocation
range: 0xffffffff80000000-0xffffffffbfffffff)
[ 0.787860] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs
on unknown-block(0,0)
_
I then booted from a live CD and ran bootrepair, with output shown info
This solved the Kernel Panic. However, now I only get a blank screen (same color as in Grub2).
When I enter Grub and select an earlier kernel, Ubuntu 18.04 loads but I only get a command line login, not a GUI. At the command I tried re-running apt-get update but this also gave errors relating to metadata, see
[user@hostname]:~$ sudo apt-get update
[sudo] password for [user]:
Ign:1 http://dl.google.com/linux/chrome-remote-desktop/deb stable InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 http://lu.archive.ubuntu.com/ubuntu bionic InRelease
Hit:5 http://lu.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://dl.google.com/linux/chrome-remote-desktop/deb stable Release
Hit:7 http://lu.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:8 http://dl.google.com/linux/chrome/deb stable Release
Get:9 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metada
ta [204 B]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 M
etadata [9,416 B]
Get:11 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 I
cons [16.3 kB]
Fetched 109 kB in 1s (111 kB/s)
AppStream system cache was updated, but problems were found: Metadata files have
errors: /var/cache/app-info/xmls/fwupd.xml
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test
-w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-ca
che > /dev/null; fi'
E: Sub-process returned an error code
[user@hostname]:~$ _
I am at a total loss how to get things up and running again.
According to janmyszkier's answer I checked the HDD for errors using the Disks utility (extended self-test) and, reassuringly, no issues were found.
I tried using a live CD and chroot method in a virtual console to try and redo the upgrade, but the errors remain. Specifically, Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory), could not load /boot/System.map-4.4.0-121-generic: No such file or directory, could not open directory /lib/modules/4.4.0-121-generic: No such file or directory, and /usr/share/initramfs-tools/hooks/plymouth failed with return 1. See below:
$sudo mount /dev/sda6 /mnt
$sudo mount --bind /dev /mnt/dev
$sudo mount --bind /proc /mnt/proc
$sudo mount --bind /sys /mnt/sys
$sudo chroot /mnt
$apt update
........
$apt upgrade
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be REMOVED:
linux-image-extra-4.4.0-121-generic
The following NEW packages will be installed:
bubblewrap
The following packages have been kept back:
libhmsbeagle1v5 phyml
The following packages will be upgraded:
apache2-bin bolt desktop-file-utils firefox-locale-en ghostscript
ghostscript-x gir1.2-gnomedesktop-3.0 gir1.2-javascriptcoregtk-4.0
gir1.2-packagekitglib-1.0 gir1.2-totem-1.0 gir1.2-webkit2-4.0 git git-man
gnome-desktop3-data gnome-initial-setup grub-common grub-pc grub-pc-bin
grub2-common gstreamer1.0-packagekit libapache2-mod-perl2
libgnome-desktop-3-17 libgs9 libgs9-common libgvc6-plugins-gtk
libjavascriptcoregtk-4.0-18 libldap-2.4-2 libldap-common
libpackagekit-glib2-18 libsmbclient libssh-4 libtotem0
libunity-settings-daemon1 libwbclient0 libwebkit2gtk-4.0-37
libwebkit2gtk-4.0-37-gtk2 openjdk-8-jre openjdk-8-jre-headless packagekit
packagekit-tools python-samba python3-distupgrade python3-update-manager
samba-common samba-common-bin samba-libs smbclient totem totem-common
totem-plugins ubuntu-keyring ubuntu-release-upgrader-core
ubuntu-release-upgrader-gtk unity-settings-daemon update-manager
update-manager-core update-notifier update-notifier-common
58 upgraded, 1 newly installed, 1 to remove and 2 not upgraded.
387 not fully installed or removed.
Need to get 0 B/83.9 MB of archives.
After this operation, 155 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)
(Reading database ... 1326337 files and directories currently installed.)
Removing linux-image-extra-4.4.0-121-generic (4.4.0-121.145) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-121-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-121-generic /boot/vmlinuz-4.4.0-121-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-121-generic /boot/vmlinuz-4.4.0-121-generic
Error! Your kernel headers for kernel 4.4.0-121-generic cannot be found.
Please install the linux-headers-4.4.0-121-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-121-generic /boot/vmlinuz-4.4.0-121-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-121-generic
WARNING: missing /lib/modules/4.4.0-121-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-121-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-121-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-121-generic (--remove):
installed linux-image-extra-4.4.0-121-generic package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.4.0-121-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)