我目前正在编写puppet config来自动设置许多系统配置,例如apache2 + php5 + mysql,nginx + php5 + mysql(实际上,任何具有任何插件和数据库的http服务都很长)。
许多软件包,例如wordpress,drupal,php5-fpm等,都取决于libapache2-mod-php5,而后者又取决于apache2,apache2-common。在非apache2配置中(使用了nginx或类似服务),这会引起诸如不必要的已安装软件包,apache2绑定到相同端口等问题。
有没有一种方法可以专门阻止程序包,更改此类程序的优先级,或者更喜欢其他可能具有较低优先级的依赖项?用什么方法可以解决问题?
您可以防止软件包安装-
在软件包名称之后添加(减号),例如:
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.
当然,您需要选择要替换的软件包,而不要使用也依赖于apache的任何依赖项,例如libapache2-mod-php5
。
上面的示例适用于wordpress和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.
您可以根据需要添加更多软件包来对其进行修改。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句