I want to remove and purge apache2 - Why does this trigger an install of php5-cgi ?

sudo apt-get --purge remove apache2

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.19.0-20 linux-headers-3.19.0-20-generic linux-image-3.19.0-20-generic linux-image-extra-3.19.0-20-generic linux-signed-image-3.19.0-20-generic linux-tools-3.19.0-20
  linux-tools-3.19.0-20-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  php5-cgi
Suggested packages:
  php-pear
The following packages will be REMOVED:
  apache2* libapache2-mod-php5*
The following NEW packages will be installed:
  php5-cgi
0 upgraded, 1 newly installed, 2 to remove and 15 not upgraded.
Need to get 4,419 kB of archives.
After this operation, 8,152 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

When I issued above it did infact install that new package !!! I would not think its an alternative

up vote 3 down vote accepted

The package php5 depends on having either apache2 or cgi installed.

The two main options to satisfy this dependency is either libapache2-mod-php5 or php5-cgi.

If you remove one, the system will install the other, otherwise php5 would have an unmet dependency.

You can see the dependencies at php5 in the Ubuntu packages database.

  • OK next time I first remove php5 then apache2 – Scott Stensland Jul 8 '15 at 16:01

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.