I have installed PHP 5 from source for various reasons (mostly because readline is broken in the Debian packages, and we use that for tab completion in a CLI backend).

When I run apt-get update && apt-get upgrade to update the server, packages that depend on php update themselves, and .... re-install PHP from the repo. This, of course, breaks readline and a number of other things because I don't have all the various php-xxx packages installed (because I compile from source).

Question is: how do I either a) tell Debian don't install PHP 5 - I have it already or b) tell Debian "I know that apt just installed the repo packages, but don't use them. Use the compiled versions, please"?

Right now my solution is to just re-run the scripts I use to compile PHP, but that takes 10+ minutes each time. And, I have to remember to do it! I would prefer to set it and forget it.


This should be pretty simple. Just do "sudo apt-mark hold php*" or "echo php* hold | dpkg --set-selections" and update afterwards. All packages should get updated except php.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.