Você pode impedir a instalação do pacote adicionando um sinal -
(menos) após o nome do pacote, por exemplo:
sudo apt-get install wordpress nginx-full php5 mariadb-client php5-mysqlnd apache2-
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'apache2' is not installed, so not removed
The following NEW packages will be installed:
libdbd-mysql-perl libjs-cropper libjs-prototype libjs-scriptaculous
libmariadbclient18 libphp-phpmailer libphp-snoopy mariadb-client
mariadb-client-5.5 mariadb-client-core-5.5 mariadb-common nginx-common
nginx-full php5 php5-cgi php5-gd php5-mysqlnd wordpress wordpress-l10n
wordpress-theme-twentyfourteen wordpress-theme-twentytwelve
0 upgraded, 21 newly installed, 0 to remove and 24 not upgraded.
Claro, você precisa selecionar qual pacote irá substituí-lo e não usar nenhuma das dependências que também depende do apache como libapache2-mod-php5
.
O exemplo acima foi para wordpress, para drupal:
sudo apt-get install drupal7 nginx-full apache2-
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'apache2' is not installed, so not removed
The following extra packages will be installed:
dbconfig-common libdbd-mysql-perl mysql-client mysql-client-5.5 mysql-server
mysql-server-5.5 mysql-server-core-5.5 nginx-common php5 php5-cgi php5-gd
php5-mysql wwwconfig-common
The following NEW packages will be installed:
dbconfig-common drupal7 libdbd-mysql-perl mysql-client mysql-client-5.5
mysql-server mysql-server-5.5 mysql-server-core-5.5 nginx-common nginx-full
php5 php5-cgi php5-gd php5-mysql wwwconfig-common
0 upgraded, 15 newly installed, 0 to remove and 24 not upgraded.
Você pode modificá-lo adicionando mais pacotes, se quiser.