Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

I have to reconfigure PHP with some extra options but since I downloaded it on Ubuntu using apt-get I can't seem to find the source anywhere (php -i points the source to a tmp folder which no longer exists).

Is there anyway to reconfigure without having to use apt-get -o=?

One of my issues is that I need the version to say the same (5.3.2) doing an apt-get now tries to download 5.3.3

share|improve this question
you will have to go download the source manually to reconfigure it, also finding a specific version can sometimes be tricky... what package are we talking about? – Stefan Oct 5 '10 at 11:04
The package was PHP5 (which since I first downloaded it has went up by a point). – Toby Oct 5 '10 at 11:08
up vote 4 down vote accepted

Christopher's answer made me go read the manpage and you can specify the version when downloading the source with apt-get.

From the apt-get manpage.



A specific source version can be retrieved by postfixing the source name with an equals and then the version to fetch, similar to the mechanism used for the package files. This enables exact matching of the source package name and version, implicitly enabling the APT::Get::Only-Source option.

Note that source packages are not tracked like binary packages, they exist only in the current directory and are similar to downloading source tar balls.

so running

apt-get source php5=5.3.2

should do the trick

share|improve this answer

apt-get source $PACKAGE=$PACKAGEVERSION will download the source for a package to the current directory.

apt-get build-dep $PACKAGE will install the build dependencies for a package so you can build it.

dpkg-buildpackage will build it.

dpkg -i $PACKAGEFILE will install a package file. (.deb)

share|improve this answer

If you mean the configuration that happens when you install the package, then

dpkg-reconfigure php5

If you mean you want to recompile the package with different compile-time configuration, then, if the package is still available from your configured sources:

apt-get source php5=5.3.2

If the package has fallen off the repositories, you'll have to search for it on the web. All Debian packages are archived at snapshot.debian.org.

share|improve this answer

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.