Gallery2 and Lenny

During the upgrade from Etch to Lenny I was surprised that the Gallery2 package was not available for the current stable release of Debian. At first it was no problem, but the Gallery2 package of old stable Etch is to old for the most recent WPG2 plug-in for WordPress, so I had to upgrade Gallery2 using a upstream version as one of the package maintainers made clear:

“Gallery2 is not available in Lenny due to the large amount of differences between the previous version and 2.3-1 from unstable. The release team decided not to include Gallery2 in stable due to this disruptive change late in the release process. The gallery2 package from sid can be installed via pinning.”

I’ve documented the steps I took for upgrading Gallery2.

1. Create to following file if it not exists:

vi /etc/apt/preferences

2. Add the following lines:

Package: * Pin: release a=stable Pin-Priority: 600 Package: gallery2 Pin: release a=testing Pin-Priority: 800

  • If you are using testing Debian make sure testing is the bigger number.
  • This file will install only from the highest pin but it will show you if the packages is available in testing or unstable.

3. Edit /etc/apt/sources.list and add the following lines:

Testing (squeeze) for gallery2 deb squeeze main contrib non-free deb-src squeeze main contrib non-free

4. Update the apt database and upgrade the gallery2 package:

apt-get update # apt-get upgrade -s

You’ll notice that the package will be kept back. Issue a dist-upgrade to install the upstream package.

apt-get dist-upgrade

Restart apache and as soon as you visit the gallery2 site you’ll be asked to start the upgrade process, which went very smoothly.