apt always tries to remove locally created package when installing dependancies

1

I've a locally compiled version of apache, which in the control file has

Replaces: apache2, apache2-mpm, httpd, httpd-cgi, apache2-mpm-prefork, apache2-utils, apache2-common, apache2.2-bin, apache2.2-common
Conflicts: apache2, apache2-mpm, httpd, httpd-cgi, apache2-mpm-prefork, apache2-utils, apache2-common, apache2.2-bin, apache2.2-common

However if I then do apt-get install php5, apt tries to remove my package and install the apache packages from the ubuntu repository.

I've tried swapping Replaces, Conflicts and Provides but can't seem to get it to keep my local package, the package is priority "optional" which is the same as apache2.

Does anyone know how I can configure my package to replace ubuntu's apache?

Rwky

Posted 2010-10-25T02:16:33.477

Reputation: 648

Answers

1

This would be because the php5 package has a dependency (possibly indirect) that your packages don't satisfy. Try using aptitude instead of apt-get, perhaps passing it the option -v one or more times, so as to get a more detailed report of what the troublesome dependency chain is; or use aptitude interactively so as to be able to explore the dependency chain easily (request the installation of php5 and look at the conflict resolution proposals).

The easiest way of satisfying dependencies would be to use the Ubuntu compilation scripts for your own version of Apache, so as to have the same package names and greater version numbers, which should satisfy all dependencies.

If all else fails, you could use the equivs-build tool from the equivs package to build a trivial package to satisfy the missing dependencies.

Gilles 'SO- stop being evil'

Posted 2010-10-25T02:16:33.477

Reputation: 58 319

That worked thanks, I used the ubuntu control file to compile my own with a higher version number as you suggested :) – Rwky – 2010-10-26T01:48:07.057

1

Install your packages and mark them hold.

BillThor

Posted 2010-10-25T02:16:33.477

Reputation: 9 384

I've tried this but then aptitude asks me to resolve conflicts and apt-get just ignores it and tries to remove my apache – Rwky – 2010-10-25T14:33:49.013

There is a dependency on libapache-mod-php5 among others. With your custom apache, you likely don't have this package. You can meet the dependency by installing php5-common. This may solve your problem. – BillThor – 2010-10-25T21:20:06.453