We had Apache web server on Ubuntu 18.04 server. After our developers decided to use NGINX, we remove Apache and install NGINX. I had remove Apache with: - apt remove ... - systemctl stop apache2 - systemctl disable apache2 - check if something exists in /etc/systemd/apache* (nothing was there).

It works as it should, but I noticed the next lines in the log:

-- Reboot --
Jun 11 09:33:28 ela1 systemd[1]: Starting LSB: Apache2 web server...
Jun 11 09:33:28 ela1 apache2[892]: /etc/init.d/apache2: 46: .: Can't open /etc/apache2/envvars
Jun 11 09:33:29 ela1 apache2[892]: /etc/init.d/apache2: 57: .: Can't open /etc/apache2/envvars
Jun 11 09:33:29 ela1 systemd[1]: Started LSB: Apache2 web server.

Any idea how to get rid of Apache?


Try to purge it with:

sudo apt-get purge apache2


sudo apt-get remove --purge apache2 apache2-utils
  • Tnx. It works. Quick help :-) – JanezKranjski Jun 11 '19 at 7:59
  • 1
    @JanezKranjski if this answer solved your problem please mark it as accepted by using the check mark on the left hand side of this answer. – Arronical Jun 11 '19 at 8:19
  • Tnx for this. Done :-) – JanezKranjski Jun 11 '19 at 9:38

Usually if you want to remove package and config files your should use purge. The best way to remove package and its configuration files and dependencies system wide is to use sudo apt-get --purge autoremove

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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