Server Fault is a question and answer site for system and network administrators. 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

Currently, my PHP is on 5.3.3, how can I upgrade it? Also how can I upgrade anything? For example, if I want to upgrade phpMyAdmin as well?

share|improve this question
up vote 22 down vote accepted

Upgrade all packages:

apt-get update; apt-get upgrade;

If you want to upgrade just one package (e.g. php5):

apt-get update; apt-get install php5;

For the package versions available on Debian take a look at:

If you want to install php5 5.4.4-2, that is only available on wheezy, you should add wheezy to your /etc/apt/sources.list:

deb wheezy main non-free contrib

and then:

apt-get update
apt-get install -t wheezy php5

To don't get any surprises, you should use apt pinning in order to prevent that your system from installing packages from wheezy, just create the file /etc/apt/preferences

Package: *
Pin: release n=squeeze
Pin-Priority: 650

Package: *
Pin: release n=wheezy
Pin-Priority: -10

So when that when you do apt-get install, if you don't specify -t wheezy it will by default install the package from squeeze.

share|improve this answer
The only php5 available on is 5.3.3: How can I upgrade it to higher version? Or am I missing something? – Doug Jul 4 '12 at 20:05
Is there a downside to installing from wheezy? – Doug Jul 4 '12 at 20:07
No, wheezy is quite stable it has been frozen the 30th of June and is going to be released as the next Debian 7. – Daniel Prata Almeida Jul 4 '12 at 20:12
A mention to backports would be fine here, as well as explaining briefly how to use apt-get source apt-get build-dependencies debuild – dawud Apr 12 '13 at 5:23

Pinning is going to put you in dependency hell, as @Juan noticed. When I want the bleeding edge on my Debian systems I usually turn to

For proper instructions ->

share|improve this answer
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Scott Pack Oct 30 '12 at 20:34
I'm going to disagree, the canonical source for how to install dot deb will forever be their site, paraphrasing it here wont provide a reliable service. (assuming the document changes some day) Of course If someone has a question about the installation document, serverfault would be a good place to flush that out. – foocorpluser Nov 6 '12 at 20:13
One of the purposes of StackOverflow, and by extension the rest of the sites, was to eliminate the spaghetti mess of links for this type of information. Whether we disagree or not making these sites the information storage mechanism is a major purpose of the system. – Scott Pack Nov 6 '12 at 20:26
I would like to point people away from DotDeb (response from above) - it did not work as they said it would, and when I hunted all over their website there is no where to ask questions, no email, no forum, no contact and no help at all. Some will suggest that this could be a level of knowledge I am lacking. However in my defence there are simply dependencies missing from their solution as I tried to install php56 on my Debian 7 system. The message direct from aptitude: --- libapache2-mod-php5 (>= 5.6.0-1~dotdeb.1~) | libapache2-mod-php5filter (>= 5.6.0-1~dotdeb.1~) | php5-cgi (>= 5.6.0-1~dotde – muz the axe Sep 23 '14 at 1:11

Debian stable is designed to be really, really stable; thus using newer versions of packages is usually not supported, often tricky and/or a bad idea, and sometimes impossible. That said, there are ways to do it:

  • Check out, see if the package you want is there - this is the "supported" way.
  • If not available, do a simple sid backport: (use the dev libraries installed on your system to compile the package sources from debian testing or unstable)
  • Installing .debs from a different repository (e.g. wheezy or ubuntu) is a very bad idea.

If no backport is available, and a simple sid backport is not possible, then you probably will not be able to get the package working on your system. You can consider upgrading to debian testing (which is not so bad when testing is under freeze, as Debian Wheezy is as of this writing).

This answer would not be complete without repeating the "simple sid backport" instructions given by the dpkg bot on

  1. Open sources.list and add a deb-src line for sid (not a deb line!)
  2. enable debian-backports (
  3. execute the following in your terminal of choice:
    • aptitude update;
    • aptitude install build-essential;
    • aptitude build-dep packagename;
    • apt-get -us -uc -b source packagename
  4. install the resultant debs.

See also:

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.