要在Ubuntu上卸载Apache2,请按照以下步骤操作:
打开终端(快捷键:Ctrl + Alt + T)
首先,停止Apache2服务,运行以下命令:
sudo systemctl stop apache2
sudo apt-get purge --auto-remove apache2 apache2-utils apache2.2-bin apache2-common
这个命令会删除Apache2及其相关组件。--auto-remove
选项会在卸载过程中自动删除不再需要的依赖项。
sudo rm -rf /etc/apache2 /var/www/html
sudo apt-get update
现在,Apache2已经从你的Ubuntu系统上卸载完成了。