在 ubuntu 14.04 中安装 apache 2 时出现问题:dpkg:- 处理包 javascript-common 时出错(--configure):

在 ubuntu 14.04 中安装 apache 2 时出现问题:dpkg:- 处理包 javascript-common 时出错(--configure):

我试图在卸载 Apache 2 后重新安装它。但在使用命令安装它时-

sudo apt-get install apache2

我收到错误-

rahul@rahulpc:~$ sudo apt-get install apache2
[sudo] password for rahul: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
apache2 is already the newest version.
The following packages were automatically installed and are no longer required:
  libblas3 liblinear-tools liblinear1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 474 not upgraded.
1 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 javascript-common (11) ...
dpkg: error processing package javascript-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 javascript-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

我认为我在卸载 apache 2 时删除了一些必要的目录。有人能帮我恢复文件并安装 apache 2 吗?

答案1

删除 javascript common 并重新安装:

sudo apt-get purge javascript-common 

sudo apt-get install javascript-common

然后安装包。

来源 :http://ubuntuforums.org/showthread.php?t=2232128

答案2

我卸载它,然后 dpkg 重新配置

apt-get --purge 删除 javascript-common

sudo dpkg--configure-a

如果你需要它,请再次安装

sudo apt-get 更新

sudo apt-get 安装 javascript-common

答案3

我的问题是 javascript-common(我使用 Dedian)未配置。我的解决方案是删除它并在安装 javascript-common 之前安装 apache2。看来 javascript-common 需要一些配置文件存在才能对其进行配置。

sudo touch /etc/apache2/conf-available/javascript-common.conf

sudo apt-get install apache2

手动下载 javascript-common_11_all.deb 包并使用

dpkg -i  javascript-common_11_all.deb --force-all

祝你好运

相关内容