Upgrading Ubuntu on Windows from Trusty 14.04 to Xenial 16.04

Here’s a quick guide to what I did to upgrade the version of Ubuntu that Microsoft ships as part of the new “Linux on Windows” subsystem. Fair warning: This might destroy your Linux install. You might be able to skip the Vivid stuff at the start, but I haven’t tried that.

Upgrade to Vivid

In your /etc/apt/sources.list replace “trusty” with “vivid” and then “apt-get update && apt-get upgrade” and basically force install every upgrade you can. Eventually you’ll get to a point where “initscripts” is failing to configure, and you’ll need to workaround the issue.

Make initscripts configure properly

This Ubuntu on Windows doesn’t really have a boot system, so initscripts will fail horribly. Instead, let’s just pretend like the configuration is doing something useful by setting both /usr/sbin/update-d.rc and /sbin/runlevel to:

#!/bin/bash
exit 0

Then run mkdir /run/shm. Now try dpkg --configure -a again.

Upgrade to Xenial

Update your /etc/apt/sources.list again to point to xenial (replacing vivid). Now:

apt-get update
apt-get -f install

Fix update-rc.d and that nonsense again

You’ll need to replace update-rc.d again (and remember to run chmod a+x on it so that it’s executable).

(Continue) Upgrading to Xenial

Run the upgrade again…

apt-get upgrade

This will fail towards the end, run:

apt-get -f install

You’ll be asked that /etc/default/rcS has been modified; you want to keep the current version with N, because it relates to how Windows stores time in the BIOS differently.

Enjoy your Xenial install