'/usr/sbin/apache2' 属于哪个软件包?

'/usr/sbin/apache2' 属于哪个软件包?

我按照下面的命令顺序安装了 Apache 后,出现了错误:/usr/sbin/apache2ctl: 171: /usr/sbin/apache2ctl: /usr/sbin/apache2: not found。经过一番谷歌搜索,我发现它是 Apache2 依赖项的一部分,但显然它缺失了。有人知道是哪个依赖项吗?

命令序列:

sudo apt-get install apache2.2-common
sudo apt-get install apache2
sudo apache2ctl start -k


在谷歌搜索了一番之后,我认为我应该尝试一下,sudo service apache2 start但结果却出现了错误:No apache MPM package installed。我尝试使用命令来安装该包sudo apt-get install apache2-mpm-prefork。我在这里发布了结果。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  apache2-mpm-worker
The following NEW packages will be installed:
  apache2-mpm-prefork
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B/2.398 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you requested:
 apache2 depends on apache2-mpm-worker (= 2.2.22-1ubuntu1.4) | apache2-mpm-prefork (= 2.2.22-1ubuntu1.4) | apache2-mpm-event (= 2.2.22-1ubuntu1.4) | apache2-mpm-itk (= 2.2.22-1ubuntu1.4); however:
  Package apache2-mpm-worker is to be removed.
  Package apache2-mpm-prefork is not installed.
  Package apache2-mpm-event is not installed.
  Package apache2-mpm-itk is not installed.
(Reading database ... 267257 files and directories currently installed.)
Removing apache2-mpm-worker ...
No apache MPM package installed
Selecting previously unselected package apache2-mpm-prefork.
(Reading database ... 267251 files and directories currently installed.)
Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.2.22-1ubuntu1.4_amd64.deb) ...
Setting up apache2-mpm-prefork (2.2.22-1ubuntu1.4) ...
No apache MPM package installed

答案1

您可以使用 dpkg 命令来找出文件所属的包

dpkg -S /path/to/file

例如:

$ dpkg -S /usr/sbin/apache2ctl
apache2.2-common: /usr/sbin/apache2ctl

该文件属于包apache2.2-common

答案2

我设法通过删除所有带有“apache”的软件包,然后再次安装 Apache 来解决此问题。

sudo apt-get install -f
sudo dpkg --purge gezgsdgdfg*
sudo apt-get install -f
sudo apt-get install apache2

相关内容