尝试安装 apache2 时出错

尝试安装 apache2 时出错

我已经重新安装了 VPS,但是当我尝试通过以下方式安装 apache2 时:

 apt-get install apache2

我明白了:

Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    apache2 is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    5 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Setting up syslog-ng-core (3.3.4.dfsg-2ubuntu1) ...
    Processing triggers for syslog-ng-core ...
     * Stopping system logging syslog-ng                                              [ OK ] 
     * Starting system logging syslog-ng                                                     Error opening file for reading; filename='/proc/kmsg', error='Operation not permitted (1)'
    Error initializing source driver; source='s_src', id='s_src#1'
    Error initializing message pipeline;
                                                                                      [fail]
    invoke-rc.d: initscript syslog-ng, action "start" failed.
    dpkg: error processing syslog-ng-core (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of syslog-ng-mod-sql:
     syslog-ng-mod-sql depends on syslog-ng-core (= 3.3.4.dfsg-2ubuntu1); however:
      Package syslog-ng-core is not configured yet.
    dpkg: error processing syslog-ng-mod-sql (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of syslog-ng:
     syslog-ng depends on syslog-ng-core (>= 3.3.4.dfsg); however:
      Package syslog-ng-core is not configured yet.
     syslog-ng depends on syslog-ng-mod-sql; however:
      Package syslog-ng-mod-sql is not configured yet.
    dpkg: error processing syslog-ng (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of syslog-ng-mod-json:
     syslog-ng-mod-json depends on syslog-ng-core (= 3.3.4.dfsg-2ubuntu1); however:
      Package syslog-ng-core is not configured yet.
    dpkg: error procNo apport report written because the error message indicates its a followup error from a previous failure.
                                     No apport report written because the error message indicates its a followup error from a previous failure.
                                                      No apport report written because MaxReports is reached already
                           No apport report written because MaxReports is reached already
                                                                                         essing syslog-ng-mod-json (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of syslog-ng-mod-mongodb:
     syslog-ng-mod-mongodb depends on syslog-ng-core (= 3.3.4.dfsg-2ubuntu1); however:
      Package syslog-ng-core is not configured yet.
    dpkg: error processing syslog-ng-mod-mongodb (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     syslog-ng-core
     syslog-ng-mod-sql
     syslog-ng
     syslog-ng-mod-json
     syslog-ng-mod-mongodb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    root@vps29386:~# apt-get install --reinstall apache2
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
    5 not fully installed or removed.
    Need to get 0 B/1,484 B of archives.
    After this operation, 0 B of additional disk space will be used.
    (Reading database ... 25092 files and directories currently installed.)
    Preparing to replace apache2 2.2.22-1ubuntu1 (using .../apache2_2.2.22-1ubuntu1_amd64.deb) ...
    Unpacking replacement apache2 ...
    Setting up syslog-ng-core (3.3.4.dfsg-2ubuntu1) ...
    Setting up apache2 (2.2.22-1ubuntu1) ...
    Processing triggers for syslog-ng-core ...
     * Stopping system logging syslog-ng                                                                                   [ OK ] 
     * Starting system logging syslog-ng                                                                                          Error opening file for reading; filename='/proc/kmsg', error='Operation not permitted (1)'
    Error initializing source driver; source='s_src', id='s_src#1'
    Error initializing message pipeline;
                                                                                                                           [fail]
    invoke-rc.d: initscript syslog-ng, action "start" failed.
    dpkg: error processing syslog-ng-core (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of syslog-ng-mod-sql:
     syslog-ng-mod-sql depends on syslog-ng-core (= 3.3.4.dfsg-2ubuntu1); however:
      Package syslog-ng-core is not configured yet.
    dpkg: error processing syslog-ng-mod-sql (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of syslog-ng:
     syslog-ng depends on syslog-ng-core (>= 3.3.4.dfsg); however:
      Package syslog-ng-core is not configured yet.
     syslog-ng depends on syslog-ng-mod-sql; however:
      Package syslog-ng-mod-sql is not configured yet.
    dpkg: error processing syslog-ng (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of syslog-ng-mod-json:
     syslog-ng-mod-json depends on syslog-ng-core (= 3.3.4.dfsg-2ubuntu1); however:
      Package syslog-ng-core is not configured yet.
    dpkg: error procNo apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                              No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because MaxReports is reached already
                                          No apport report written because MaxReports is reached already
                                                                                                        essing syslog-ng-mod-json (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of syslog-ng-mod-mongodb:
     syslog-ng-mod-mongodb depends on syslog-ng-core (= 3.3.4.dfsg-2ubuntu1); however:
      Package syslog-ng-core is not configured yet.
    dpkg: error processing syslog-ng-mod-mongodb (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     syslog-ng-core
     syslog-ng-mod-sql
     syslog-ng
     syslog-ng-mod-json
     syslog-ng-mod-mongodb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

这是我的 /var/syslog 文件:

        Aug 26 12:22:42 stock kernel: last message repeated 2315005 times
    Aug 26 12:22:42 stock named[448]: validating @0x7fec1c002090: . NS: got insecure response; parent indicates it should be secure
    Aug 26 12:22:42 stock named[448]: error (insecurity proof failed) resolving './NS/IN': 2001:500:2f::f#53
    Aug 26 12:22:42 stock kernel: Cannot read proc file system: 1 - Operation not permitted.
    Aug 26 12:22:42 stock kernel: last message repeated 1555 times
    Aug 26 12:22:42 stock named[448]: success resolving './NS' (in '.'?) after disabling EDNS
    Aug 26 12:22:42 stock kernel: Cannot read proc file system: 1 - Operation not permitted.
    Aug 26 12:22:42 stock kernel: last message repeated 31101 times
    Aug 26 12:22:42 stock named[448]: success resolving './DNSKEY' (in '.'?) after disabling EDNS
    Aug 26 12:22:42 stock named[448]: managed-keys-zone ./IN: No DNSKEY RRSIGs found for '.': success
    Aug 26 12:22:42 stock kernel: Cannot read proc file system: 1 - Operation not permitted.
    Aug 26 12:23:13 stock kernel: last message repeated 3675566 times
    Aug 26 12:24:14 stock kernel: last message repeated 6173756 times
    Aug 26 12:24:50 stock kernel: last message repeated 3813997 times
    Aug 26 12:24:50 stock kernel: Kernel logging (proc) stopped.
    Aug 26 12:24:50 stock rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="140" x-info="http://www.rsyslog.com"] exiting on signal 15.

答案1

它是虚拟机吗?

尝试编辑文件/etc/default/syslog-ng

取消注释该行SYSLOGNG_OPTS="--no-caps"reboot机器,然后重试。

相关内容