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

  • 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, 2010 at 11:04
  • The package was PHP5 (which since I first downloaded it has went up by a point).
    – Toby
    Oct 5, 2010 at 11:08

3 Answers 3


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)


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


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.

You must log in to answer this question.

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