5

I would like to install the mediawiki package on Debian Wheezy. mediawiki has dependencies on (apache2 OR httpd) and MySQL, but I want to use nginx-extras (which provides httpd) and Sqlite (i.e. not Apache and not MySQL).

I first installed nginx-extras, which automatically installed httpd. But when I tried to install the mediawiki with

apt-get install mediawiki

it tried to install various Apache modules.

How can I remind apt-get that it shouldn't install Apache because the package httpd has already been provided?

I have also installed php5-sqlite, and mediawiki needs one of php5-sqlite, php5-pgsql or php5-mysql. However, apt-get also wanted to install the modules associated with the MySQL server.

I tried

apt-get install mediawiki

on an Ubuntu system and it seemed to respect the fact that httpd was already installed.

Have I uncovered a Debian bug, or am I missing some configuration option in Debian?

2
  • META: I have a problem. Both of the answers I received (from Braiam and Gilles) helped me in equal measure: Braiam's was a direct answer to my question, but Gilles provided a more appropriate solution to my problem. Together they enabled me to do exactly what was needed. Whose answer should I accept, or can I accept both? Dec 31, 2014 at 1:56
  • I recommend picking the one which you think will be most useful to someone else who has the same problem.
    – Graeme
    Dec 31, 2014 at 17:43

2 Answers 2

4

I'm suspecting a bug in either apt or mediawiki control file. mediawiki needs either apache2 or httpd installed. APT prefers the first package and if it's not available then goes for the next one, but in this case the next is a virtual package httpd, which is also provided by apache2-bin. I presume this confuses apt which decides to install apache2 just to play safe.

This can be solved two ways, you can tell in a explicit way that you don't want apache installed:

➜  ~  apt-get -s install nginx-extras mediawiki apache2-bin-
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'apache2-bin' is not installed, so not removed
The following extra packages will be installed:
  libdbd-mysql-perl libjs-jquery-cookie libjs-jquery-form libjs-jquery-tipsy
  libluajit-5.1-2 libluajit-5.1-common libonig2 libqdbm14 mediawiki-classes
  mediawiki-extensions-base mysql-client-5.5 mysql-server mysql-server-5.5
  mysql-server-core-5.5 nginx-common php-wikidiff2 php5 php5-cgi php5-cli
  php5-json php5-mysql php5-readline ssl-cert
Suggested packages:
  imagemagick php5-gd mediawiki-extensions-math memcached clamav tinyca
  fcgiwrap nginx-doc php-pear openssl-blacklist
The following NEW packages will be installed:
  libdbd-mysql-perl libjs-jquery-cookie libjs-jquery-form libjs-jquery-tipsy
  libluajit-5.1-2 libluajit-5.1-common libonig2 libqdbm14 mediawiki
  mediawiki-classes mediawiki-extensions-base mysql-client-5.5 mysql-server
  mysql-server-5.5 mysql-server-core-5.5 nginx-common nginx-extras
  php-wikidiff2 php5 php5-cgi php5-cli php5-json php5-mysql php5-readline
  ssl-cert
0 upgraded, 25 newly installed, 0 to remove and 0 not upgraded.
Inst libluajit-5.1-common (2.0.3+dfsg-3 Debian:testing [all])
Inst libluajit-5.1-2 (2.0.3+dfsg-3 Debian:testing [amd64])
Inst libonig2 (5.9.5-3.1 Debian:testing [amd64])
Inst libdbd-mysql-perl (4.028-2+b1 Debian:testing [amd64])
Inst mysql-client-5.5 (5.5.40-1 Debian:testing [amd64])
Inst mysql-server-core-5.5 (5.5.40-1 Debian:testing [amd64])
Inst mysql-server-5.5 (5.5.40-1 Debian:testing [amd64])
Inst php5-mysql (5.6.4+dfsg-1 Debian:testing [amd64])
Inst libqdbm14 (1.8.78-5+b1 Debian:testing [amd64])
Inst php5-json (1.3.6-1 Debian:testing [amd64])
Inst php5-cli (5.6.4+dfsg-1 Debian:testing [amd64])
Inst php5-readline (5.6.4+dfsg-1 Debian:testing [amd64])
Inst libjs-jquery-cookie (10-1 Debian:testing [all])
Inst libjs-jquery-form (10-1 Debian:testing [all])
Inst libjs-jquery-tipsy (10-1 Debian:testing [all])
Inst nginx-common (1.6.2-5 Debian:testing [all])
Inst nginx-extras (1.6.2-5 Debian:testing [amd64])
Inst php5-cgi (5.6.4+dfsg-1 Debian:testing [amd64])
Inst php5 (5.6.4+dfsg-1 Debian:testing [all])
Inst mediawiki-classes (1:1.19.20+dfsg-2.2 Debian:testing [all])
Inst mediawiki (1:1.19.20+dfsg-2.2 Debian:testing [all])
Inst mediawiki-extensions-base (3.7 Debian:testing [all])
Inst mysql-server (5.5.40-1 Debian:testing [all])
Inst php-wikidiff2 (1.2+git03ea59f-1 Debian:testing [amd64])
Inst ssl-cert (1.0.35 Debian:testing [all])
Conf libluajit-5.1-common (2.0.3+dfsg-3 Debian:testing [all])
Conf libluajit-5.1-2 (2.0.3+dfsg-3 Debian:testing [amd64])
Conf libonig2 (5.9.5-3.1 Debian:testing [amd64])
Conf libdbd-mysql-perl (4.028-2+b1 Debian:testing [amd64])
Conf mysql-client-5.5 (5.5.40-1 Debian:testing [amd64])
Conf mysql-server-core-5.5 (5.5.40-1 Debian:testing [amd64])
Conf mysql-server-5.5 (5.5.40-1 Debian:testing [amd64])
Conf php5-mysql (5.6.4+dfsg-1 Debian:testing [amd64])
Conf libqdbm14 (1.8.78-5+b1 Debian:testing [amd64])
Conf php5-json (1.3.6-1 Debian:testing [amd64])
Conf php5-cli (5.6.4+dfsg-1 Debian:testing [amd64])
Conf php5-readline (5.6.4+dfsg-1 Debian:testing [amd64])
Conf libjs-jquery-cookie (10-1 Debian:testing [all])
Conf libjs-jquery-form (10-1 Debian:testing [all])
Conf libjs-jquery-tipsy (10-1 Debian:testing [all])
Conf nginx-common (1.6.2-5 Debian:testing [all])
Conf nginx-extras (1.6.2-5 Debian:testing [amd64])
Conf php5-cgi (5.6.4+dfsg-1 Debian:testing [amd64])
Conf php5 (5.6.4+dfsg-1 Debian:testing [all])
Conf mediawiki-classes (1:1.19.20+dfsg-2.2 Debian:testing [all])
Conf mediawiki (1:1.19.20+dfsg-2.2 Debian:testing [all])
Conf mediawiki-extensions-base (3.7 Debian:testing [all])
Conf mysql-server (5.5.40-1 Debian:testing [all])
Conf php-wikidiff2 (1.2+git03ea59f-1 Debian:testing [amd64])
Conf ssl-cert (1.0.35 Debian:testing [all])

or you can report a bug to mediawiki package asking for apache2 dependency to be removed since it's already listed as provider of the httpd virtual package, in which case it should solve the issue.

Whenever you don't want a package installed, you can append a minus - to the package name you don't want installed, and apt will respect it, as seen in the example.

2
  • It's perfectly normal for mediawiki to depend on apache2 | httpd: that causes apache2 to be chosen as the default way to fulfill the httpd dependency. Passing apache2-bin- should work nonetheless. Dec 31, 2014 at 0:34
  • Thanks for the hint with the - suffix. That was what I was looking for and also enabled me to suppress the installation of MySQL. Dec 31, 2014 at 1:51
2

apt-get does know that httpd has been provided. It must be installing Apache to fulfill some other dependency, possibly php5 which prefers libapache2-mod-php5. Try explicitly installing php5-cgi or php5-fpm instead to fulfill php5's dependency.

If you don't understand why apt-get is pulling in some package, use Aptitude. It's both a command line front-end with a bit more capabilities than apt-get and a text mode full-screen interface. When a package is pulled in for automatic installation, aptitude tells you why (in the full screen interface, it's visible without ado: press g after making your selections and highlight the package you're wondering about in the confirmation screen).

1
  • Thanks for this. Once I had installed php5-fpmthe dependency on Apache disappeared. Dec 31, 2014 at 1:47

You must log in to answer this question.

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