尝试在 Lubuntu 18.04 上安装 Apache2:处理时遇到错误:apache2

尝试在 Lubuntu 18.04 上安装 Apache2:处理时遇到错误:apache2

当我尝试在我的计算机上安装 apache2 时,出现以下信息:

After this operation, 534 kB of additional disk space will be used.
Selecting previously unselected package apache2.
(Reading database ... 249419 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.29-1ubuntu4.5_amd64.deb ...
Unpacking apache2 (2.4.29-1ubuntu4.5) ...
Processing triggers for ufw (0.35-5) ...
Setting up apache2 (2.4.29-1ubuntu4.5) ...
info: Executing deferred 'a2enconf gitweb' for package gitweb
ERROR: Conf gitweb does not exist!
dpkg: error processing package apache2 (--configure):
 installed apache2 package post-installation script subprocess returned error exit status 1
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for gitweb (1:2.17.1-1ubuntu0.4) ...
Package apache2 is not configured yet. Will defer actions by package gitweb.
Processing triggers for systemd (237-3ubuntu10.13) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Errors were encountered while processing:
 apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)

有人知道这个问题吗?我也尝试过:

/etc/init.d/apache2 stop
sudo apt-get purge apache2*
sudo dpkg --configure -a
sudo apt-get install -f
sudo apt install apache2

但它记录了几乎相同的问题:

<...>
Enabling site 000-default.
info: Executing deferred 'a2enconf gitweb' for package gitweb
ERROR: Conf gitweb does not exist!
dpkg: error processing package apache2 (--configure):
 installed apache2 package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (237-3ubuntu10.13) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for ufw (0.35-5) ...
Errors were encountered while processing:
 apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

来自评论:

清除 gitweb 和 apache2 并重新安装 apache2。

sudo apt-get purge apache2 && sudo apt-get purge gitweb && sudo apt-get install apache2

相关内容