5

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.

betontalpfa
  • 3,454
  • 1
  • 33
  • 65
Matt Hargett
  • 1,906
  • 1
  • 17
  • 37
  • 1
    This is a duplicate of this question (on a more suitable StackExchange site): [Unable to update ebtables on WSL](https://askubuntu.com/q/1042021/67132). Additionally this was a bug in the update scripts and it has already been resolved in a new ebtables package. The update from the old package is now successful. – pabouk - Ukraine stay strong Jul 16 '18 at 11:01

2 Answers2

5

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.

Matt Hargett
  • 1,906
  • 1
  • 17
  • 37
  • 1
    The problem was caused by the failed `stop` action not unsupported runlevels. See: [Unable to update ebtables on WSL](https://askubuntu.com/q/1042021/67132), also the patch from the linked comment: https://launchpadlibrarian.net/372611750/lp1774120-cosmic.debdiff – pabouk - Ukraine stay strong Jul 16 '18 at 11:17
  • 2
    still seeing same issues in WSL for Ubuntu 20.04 on windows 10 -- any chance you know if this issue have been fixed ? – serup Sep 29 '20 at 19:30
  • there is a solution for Debian 11? – BomAle May 17 '22 at 00:24
1

Problem could be because the service_control script is trying to use invoke-rc.d (which doesn't work because there are no runlevels in a Docker container) before trying the service command (which will work).

So change the if conditions in the script or the lazy way is make it look for a non-existent path so it will use the service command. E.g.:

if [ -x /xxxusr/sbin/invoke-rc.d ]; then
  /usr/sbin/invoke-rc.d $OMSAGENT_WS start
  elif [ -x /sbin/service ]; then
  /sbin/service $OMSAGENT_WS start
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
dbroggy
  • 338
  • 4
  • 7