AWS上有两台Ubuntu 16.04.2 LTS服务器。 我想补丁,但我得到一个错误,我不知道下一步。
sudo apt-get upgrade给了我:
Setting up supervisor (3.2.0-2ubuntu0.1) ... insserv: script supervisor: service supervisor already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package supervisor (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: supervisor E: Sub-process /usr/bin/dpkg returned an error code (1)
基于其他类似的错误,我试过:
sudo apt-get clean && sudo apt-get autoremove sudo apt-get -f install sudo dpkg --configure -a
这些服务器远非“干净”。 它们被创build为副本副本。 在软件方面,他们有PHP 7.0,Laravel,并在主pipe下运行Laravel队列。 但我不知道这是否重要。
我查看了主pipe问题列表,但是我没有发现任何似乎适用于我的问题。
看来你已经有一个主pipe已经通过其他来源安装了。 insserv程序pipe理启动脚本,并且没有注册该软件包的supervisor副本,因为它已经有一个supervisor设置为启动。 看一眼
grep Provides /etc/init.d/*
并查看哪些脚本声称提供主pipe。
至于解决这个问题,你需要跟踪现有supervisor来自哪里,并以同样的方式更新。 如果你运行dpkg -S /etc/init.d/filename它会告诉你它是否来自其他软件包(也许你已经安装了一个捆绑了另一个软件包的pipe理程序的PPA),如果没有出现,那么现有的pipe理员可能是从二进制下载手动安装的,或者是从源代码构build的。
另一个select是启动一个干净的16.4镜像(如果你想要的是php7.1而不是7.0,或者需要其他不在16.4的软件),find你需要的软件版本。 logging下你安装的所有东西,包括你安装的版本,以及你从哪里得到的东西(特别是如果没有安装包的话),并testing你的软件是否能在图像上工作。 您还需要跟踪依赖关系,特别是需要给定包的内容。 这在使用apt时不那么重要,但是如果您正在手动构build, libfoo在升级libfoo之前,需要记住检查该app是否可以使用最新版本的libfoo 。 现在进行投资会使未来更容易维持。
所以最终在诊断问题的时候,我偶然发现了这个解决scheme。 @DerfK把我放在正确的路上。 最后,即使在“删除”主pipe,然后修补服务器之后,仍然存在。 即使我使用apt-get来安装主pipe。
# removed it sudo apt-get remove supervisor # patched it sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt autoremove # after a reboot, this still lists it as running service --status-all
编辑#2我被提醒了为什么在构build服务器时保留详细的注释是很重要的。 我find一张纸条说:
created a supervisord from https://raw.githubusercontent.com/Supervisor/initscripts/master/ubuntu -Note: This should not have been necessary. supervisor is supposed to run on startup, but it wasn't sudo chmod +x /etc/init.d/supervisord sudo update-rc.d supervisord defaults
所以最终我以正确的方式安装了主pipe,但是创业公司与@DerfK暗指的不一样。 所以适当的解决办法是:
所以现在都是固定的