How to work around runlevel error in Ubuntu on Windows 10 Spring Creators Update?

Matt Hargett picture Matt Hargett · May 31, 2018 · Viewed 15.3k times · Source

When doing an apt-get dist-upgrade in Ubuntu 18.04 running on Windows 10 Spring Creators Update (RS4), I get this error:

Preparing to unpack .../ebtables_2.0.10.4-3.5ubuntu2.18.04.1_amd64.deb ...
invoke-rc.d: could not determine current runlevel
 * Error: insufficient privileges to access the ebtables rulesets.
invoke-rc.d: initscript ebtables, action "stop" failed.
dpkg: warning: old ebtables package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
invoke-rc.d: could not determine current runlevel
 * Error: insufficient privileges to access the ebtables rulesets.
invoke-rc.d: initscript ebtables, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/ebtables_2.0.10.4-3.5ubuntu2.18.04.1_amd64.deb (--unpack):
 new ebtables package pre-removal script subprocess returned error exit status 1
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
invoke-rc.d: could not determine current runlevel
Errors were encountered while processing:
 /var/cache/apt/archives/ebtables_2.0.10.4-3.5ubuntu2.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I don't really care about ebtables (it appears to be a default/built-in package) but I don't want to sift through every update's output to figure out if there's new errors beyond this one.

Answer

Matt Hargett picture Matt Hargett · May 31, 2018

It turns out that WSL didn’t support init/runlevels (which makes sense since it doesn't really have a normal Linux boot process), as mentioned here: https://github.com/Microsoft/WSL/issues/1761#issuecomment-393154803

The good news is that a fix was made in Ubuntu Cosmic that filtered down to Bionic (18.04) and Xenial (16.04): https://github.com/Microsoft/WSL/issues/1761#issuecomment-393652849

If you had this issue before, it should now be resolved.