1

I'm currently writing puppet config to automatically setup a number of system configurations, such as apache2 + php5 + mysql, nginx + php5 + mysql (in reality any http service a long with any addons and databases).

Many packages, such as wordpress, drupal, php5-fpm and more depends on libapache2-mod-php5 which in turn depends on apache2, apache2-common. In the non apache2 configurations (where nginx or similar services are used) this causes problems such as unnecessary installed packages, apache2 binds to the same port etc ..

Is there a way to specifically block packages, change priority of such or perhaps prefer other dependencies which may have lower prio? What approach can the problem be solved with?

1 Answer 1

2

You can prevent package installation adding a - (minus) sign after the package name, for example:

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.

Of course, you need to select which package will replace it and not using any of the dependencies that also depends on apache like libapache2-mod-php5.

The above example was for wordpress, for 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.

You can modify it adding more packages if you like.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .