how to upgrade already installed apache2 on debian (lenny)

I have an debian lenny box up and running with apache2 2.11.6 (this was testing stream some month agotesting some)

Now on testing stream is 2.12.1 I want to upgrade my apache2, but not the other software on this machine. So I think:

apt-get upgrade 

.. is not an option.

How can I upgrade only single packages?


Solution 1:

sudo apt-get install apache2

Solution 2:

  1. add a line for testing to your /etc/apt/sources.list.

    e.g. if you have the following sources.list already

    deb http://your.favourite.mirror/debian/ stable main non-free contrib

    then yank and paste it and change the copy to

    deb http://your.favourite.mirror/debian/ testing main non-free contrib
  2. edit or create /etc/apt/preferences to assign Pinning priorities, like so

    Package: *
    Pin: release a=testing
    Pin-Priority: 100
    
    Package: *
    Pin: release a=stable
    Pin-Priority: 500
    
  3. run "apt-get update"

  4. install apache2 from testing (along with all required dependancies) with:

    apt-get -t testing install apache2

from now on, when you run apt-get upgrade or apt-get install it will install packages from stable by default but you can override that at any time with "-t testing" to install specific packages (or even a full upgrade) from testing.

you can do the same thing with "unstable" too. just add it with a lower priority than testing.

personally, i would use unstable instead of testing. in my experience, testing is often more broken than unstable because there are often very long delays in getting crucial updates to migrate from unstable to testing - all it takes is one new (or duplicate) bug to be reported or a slightly new revision to be uploaded to unstable, and the automatic migration of a package from unstable to testing will be delayed for another week or two or more...which is more than enough time for yet another bug report or updated package to be uploaded to unstable to reset the delay all over again.