首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在Windows10Spring创建者更新上解决Ubuntu中的运行级错误?

如何在Windows10Spring创建者更新上解决Ubuntu中的运行级错误?
EN

Stack Overflow用户
提问于 2018-06-01 04:11:50
回答 2查看 13.8K关注 0票数 4

在运行Windows10Spring创建者更新(RS4)的Ubuntu18.04中执行apt-get dist-upgrade时,我收到以下错误:

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)

我真的不关心ebtables (它似乎是一个默认的/内置的包),但我不想仔细检查每个更新的输出,以找出除了这个错误之外是否还有新的错误。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-06-01 04:21:15

事实证明,WSL不支持init/runlevel(这是有意义的,因为它实际上没有正常的Linux引导过程),如下所述:https://github.com/Microsoft/WSL/issues/1761#issuecomment-393154803

好消息是,Ubuntu Cosmic中的一个修复被过滤到了仿生(18.04)和Xenial (16.04):https://github.com/Microsoft/WSL/issues/1761#issuecomment-393652849

如果您以前遇到过此问题,现在应该可以解决。

票数 4
EN

Stack Overflow用户

发布于 2020-05-16 11:51:07

问题可能是因为service_control脚本在尝试服务命令之前尝试使用invoke-rc.d (它不起作用,因为Docker容器中没有运行级别)(这会起作用)。

因此,更改脚本中的服务条件或惰性方法是让它查找不存在的路径,以便它将使用if命令。例如:

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
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50632058

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档