a quick solution is to manualy copy the liblwgeom.so.1.2 from the lenny-package to /usr/lib/postgresql/8.2/lib/liblwgeom.so.1.2 then run /usr/share/postgresql-8.2-postgis/lwpostgis_upgrade.sql for every old postgis-database. After this you can delete liblwgeom.so.1.2