apt-get 升级失败,主机名错误

apt-get upgrade failed with hostname error

我正在尝试执行 apt-get upgrade 命令,但出现以下错误:

Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^(.*?)(\)?${ <-- HERE ([^{}]+)}(.*)$/ at /usr/share/perl5/Debconf/Question.pm line 72.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/${ <-- HERE ([^}]+)}/ at /usr/share/perl5/Debconf/Config.pm line 30.
Extracting templates from packages: 100%
Preconfiguring packages ...
Setting up hostname (3.16ubuntu2) ...
insserv: warning: script 'friendly-recovery' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `friendly-recovery'
insserv: warning: script 'cron' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `cron'
insserv: warning: script 'sshd' missing LSB tags and overrides
insserv: script sshd: service sshd already provided!
insserv: There is a loop between service monit and sshd if stopped
insserv:  loop involving service sshd at depth 2
insserv:  loop involving service monit at depth 1
insserv: Stopping ssh depends on monit 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 hostname (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 hostname
E: Sub-process /usr/bin/dpkg returned an error code (1)

请帮我解决一下。这是服务器,我的所有操作都停滞不前。

真的很恐怖。此错误是由于强行升级某些包导致升级整个 OS.

因此,如果您遇到此类错误,继续使用该服务器的风险为 100%。你最后的希望是通过 deb 或 tar 文件安装所有必需的包,因为你不能再使用 apt-get。

所以请保持魅力并格式化服务器,否则继续冒险 ;)(不要在解决您的问题后恢复tart。)