安装、升级或自动删除时出错:insserv 警告:脚本“K01runlcactivator”和“runlcactivator”

安装、升级或自动删除时出错:insserv 警告:脚本“K01runlcactivator”和“runlcactivator”

我看到这些尝试安装Inkscape或安装任何软件时出现错误。

当我尝试使用sudo apt-get 安装 language-pack-en-base它显示相同错误

我也试过sudo dpkg-重新配置区域设置然后尝试安装Inkscape- 但它不起作用。

abhilash@abhilash-Inspiron-3542:~$ sudo apt-get install inkscape
[sudo] password for abhilash: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gawk libgsl2 libgtkmm-2.4-1v5 libgtkspell0 libimage-magick-perl
  libimage-magick-q16-perl libmagick++-6.q16-5v5 libwmf-bin python-numpy
  transfig
Suggested packages:
  gawk-doc pstoedit dia | dia-gnome libsvg-perl libxml-xql-perl
  python-uniconvertor ruby gsl-ref-psdoc | gsl-doc-pdf | gsl-doc-info
  | gsl-ref-html imagemagick-doc gfortran python-dev python-nose
  python-numpy-dbg python-numpy-doc xfig
The following NEW packages will be installed:
  gawk inkscape libgsl2 libgtkmm-2.4-1v5 libgtkspell0 libimage-magick-perl
  libimage-magick-q16-perl libmagick++-6.q16-5v5 libwmf-bin python-numpy
  transfig
0 upgraded, 11 newly installed, 0 to remove and 158 not upgraded.
8 not fully installed or removed.
Need to get 0 B/16.9 MB of archives.
After this operation, 107 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up util-linux (2.27.1-6ubuntu3.3) ...
insserv: warning: script 'K01runlcactivator' missing LSB tags and overrides
insserv: warning: script 'runlcactivator' missing LSB tags and overrides
insserv: There is a loop between service plymouth and procps if started
insserv:  loop involving service procps at depth 2
insserv:  loop involving service udev at depth 1
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!    
insserv:  loop involving service networking at depth 4
insserv: There is a loop between service plymouth and urandom if started
insserv:  loop involving service urandom at depth 4
insserv:  loop involving service mountdevsubfs at depth 2
insserv: There is a loop at service runlcactivator if started
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service runlcactivator and dns-clean if started
insserv:  loop involving service dns-clean at depth 1
insserv: Starting runlcactivator depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package util-linux (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 util-linux
E: Sub-process /usr/bin/dpkg returned an error code (1)
abhilash@abhilash-Inspiron-3542:~$ 

有人告诉我 -

问题是您被困在启动顺序。

以下是当我查看文件时我看到[runlcactivator]

现在请建议我如何“从 /etc/init.d/ 和 /etc/rc? 文件中彻底清除程序和脚本。” - 就像答案中所建议的那样?执行此操作的命令行是什么?

我不熟悉代码,所以如果说明具体的话,我可以直接按照说明操作。谢谢帮助!

答案1

首先,问题是您卡在了启动顺序上。

启动顺序方法在安装或升级期间决定。如果所有已安装脚本的 LSB 标头声明的依赖项中没有循环,init.d并且没有过时的脚本,则系统将转换为基于依赖项的启动顺序。我们必须检查

  1. 循环依赖项:发生于 >

    • 某些脚本缺少 LSB 标签,或者 LSB 标签存在错误,例如缺少Required-Start:Required-Stop:标签

    • 一些脚本依赖于其他脚本,而这些脚本又依赖于系统工具$all,但事实并非如此,因为依赖于的脚本$all在启动时最后加载。由于它是最后加载的,所以没有任何东西可以依赖它。因此,它会打乱基于依赖关系的启动顺序。

  2. 过时的脚本:发生于

    • 一些软件包升级到新版本时可能不使用脚本/etc/init.d/,维护者可能忘记删除旧脚本的代码。这不是我们的错误。

原因肯定是外部的。转到/etc/init.d并查看对应的文件,并确认它有一个带有, / (至少为空)runlcactivator的 LSB 注释,如下所示。ProvidesRequired-StartRequired-StopDefault-Start/Default-Stop

### BEGIN INIT INFO
# Provides :          runlcactivator
# Required-Start :
# Required-Stop :
# Default-Start :     2 3 4 5
# Default-Stop  :     0 1 6
# Short-Description : runlcactivator
# Description :       runlcactivator
### END INIT INFO

如果不存在,您可以添加 LSB 注释,或者从/etc/init.d//etc/rc?文件中彻底清除程序和脚本。有两个脚本: K01runlcactivatorrunlcactivator

请注意,我厚颜无耻地抄袭了以下答案:由于 insserv,无法使用 apt-get 安装任何内容Unix 和 Linux SE

答案2

我遇到了同样的问题,当我尝试在我的 ubuntu 系统上安装 Airtel 4G 加密狗时,该问题开始出现,但它从未起作用。

我已移动或说已删除

/etc/init.d/runlcactivator

文件,然后尝试安装软件包,我能够再次顺利安装软件包。

相关内容