0

I have apache2.service enlisted in the output of systemd-analyze critical-chain, taking more than 5.5 seconds!

Why is apache2 even installed on my system when I am not running a web server?

Response to Tomasz Gandor

Thanks, Tomasz. Here is the output response:

$ aptitude why apache2
i   phpliteadmin-themes Depends    phpliteadmin                 
i A phpliteadmin        Recommends apache2 (>= 2.4.6-4~) | httpd

And I think it's just a theme, so it would be safe to remove it. Should I?

Response to PerlDuck

Thanks, PerlDuck. Here is the output response:

$ apt-cache rdepends --installed apache2
apache2
Reverse Depends:
  libapache2-mod-php7.2
 |phpliteadmin
 |javascript-common
  libapache2-mod-php7.2

Now, I am not very much certain about what to do!

Also, there is one thing to be noted in the response of apt-cache rdepends, and that is the | sign before phpliteadmin and javascript-common. What does this indicate?

And why is libapache2-mod-php7.2 listed twice in the output, once at the top and once at the bottom of the list?

Abbas Mehdi
  • 307
  • 1
  • 6
  • 14
  • Somebody or something must have installed it. It's not there by default. – Tomasz Gandor Mar 21 '19 at 09:34
  • It seems apache2 is installed as a dependency of phpliteadmin. Uninstalling Apache2 might break it. – Kulfy Mar 21 '19 at 09:50
  • Yes of course. By "remove it", I meant removing the theme, since I am not using that theme anywhere. And then finally removing apache2. – Abbas Mehdi Mar 21 '19 at 09:53
  • 1
    The pipe symbol is explained in [What does the pipe | indicate in apt-cache rdepends?](https://askubuntu.com/q/406806/504066). Basically it means _"phpliteadmin depends on apache2 **or some other package (webserver)**"_. When running `apt show phpliteadmin` then we see it recomends either `apache2` or `httpd` and that is what the pipe symbol expresses: `phpliteadmin` needs either apache2 or some other httpd. – PerlDuck Mar 21 '19 at 10:53
  • If you want to be really sure, dig further and find out why you need `phpliteadmin`: `aptitude why phpliteadmin`. If you don't, remove that as well. – Jos Mar 21 '19 at 11:07

2 Answers2

3

If you don't have aptitude run:

sudo apt install aptitude

then:

aptitude why apache2

This will list packages. If you find any packages preceded by "i" and not "i A", that's why you have apache2.

Tomasz Gandor
  • 286
  • 2
  • 8
3

As a follow-up to @TomaszGandor's answer: in case aptitude is not istalled but apt-cache is (which I think is by default), another possibility is:

apt-cache rdepends --installed apache2

This will list all installed packages that depend on apache2.

PerlDuck
  • 13,014
  • 1
  • 36
  • 60