在运行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 (它似乎是一个默认的/内置的包),但我不想仔细检查每个更新的输出,以找出除了这个错误之外是否还有新的错误。
发布于 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
如果您以前遇到过此问题,现在应该可以解决。
发布于 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
https://stackoverflow.com/questions/50632058
复制相似问题