Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I install all the dependencies needed for the PHP package without installing the actual package for APT?

share|improve this question
up vote 2 down vote accepted

Install the PHP package with all the dependencies, then uninstall the PHP package.

share|improve this answer
Heh, fair enough :) – Christina Brooks Dec 14 '10 at 21:50

Using apt-get: apt-get -s install name_of_PHP_package shows what extra packages will be installed. To automate:

LC_ALL=C apt-get -s install |
awk '/^[^ ]/ {p=0}
     p {print}
     /^The following extra packages will be installed:/ {p=1}'

Using aptitude interactively: mark the PHP package for installation, press g, mark the automatically selected packages as manually requested with m, remove the initial package from the to-install list with -, and finally confirm the installation request with g again.

share|improve this answer
+1 for the aptitude solution. I'm certainly not apt enough about apt. – fideli Dec 15 '10 at 0:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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