Upgraded my server from Lucid to Maverick. Encountered several small errors during the upgrade of gallery2, and was left with a pretty botched installation. I ended up installing gallery2 from a tarball, outside of the normal packaging process. Details here. I usually run 'do-release-upgrade' from within a 'script' session -- highly recommended! These lines have line numbers from my script output log. 4786 Setting up apache2-mpm-prefork (2.2.16-1ubuntu3.1) ... 4787 * Starting web server apache2 Warning: DocumentRoot [/usr/share/gallery2/] does> 4788 [ OK ] 4789 Setting up apache2 (2.2.16-1ubuntu3.1) ... 5013 Setting up gallery2 (2.3-1ubuntu6) ... 5014 ln: creating symbolic link `/usr/share/gallery2/lib/smarty': No such file or directory 5015 dpkg: error processing gallery2 (--configure): 5016 subprocess installed post-installation script returned error exit status 1 5253 Errors were encountered while processing: 5254 apticron (<-- my bad) 5255 gallery2 After the bulk of the upgrade was finished, I tried 'dpkg --configure -a' to see what I could fix with the gallery2 upgrade. Again, same problem: 5376 Setting up gallery2 (2.3-1ubuntu6) ... 5377 ln: creating symbolic link `/usr/share/gallery2/lib/smarty': No such file or directory 5378 dpkg: error processing gallery2 (--configure): 5379 subprocess installed post-installation script returned error exit status 1 5380 Errors were encountered while processing: 5381 gallery2 I saw that I was complaining about /usr/share/gallery2/lib/smarty and that /usr/share/gallery2 did not exist. So I did a 'mkdir -p /usr/share/gallery2/lib/smarty' and retried 'dpkg --configure -a'. 5418 Setting up gallery2 (2.3-1ubuntu6) ... .... (curses dialog box asking to restart apache) >> Configuring gallery2 >> Remember that in order to activate the new configuration, >> apache2 has to be restarted. You can also restart apache2 >> by manually executing 'invoke-rc.d apache2 restart'. 5467 touch: cannot touch `/etc/gallery2/config.php': No such file or directory 5468 dpkg: error processing gallery2 (--configure): 5469 subprocess installed post-installation script returned error exit status 1 5470 Errors were encountered while processing: 5471 gallery2 OK, so it's looking for a config file. I did 'touch /etc/gallery2/config.php' and 'dpkg --configure -a'. 5477 Setting up gallery2 (2.3-1ubuntu6) ... .... (curses dialog box asking for database credentials) 5574 Restarting web server apache2 ... waiting [ OK ] I went to my gallery URL, and it showed me a fresh installation setup screen... I had no idea whether it knew about my existing photos or not. I think at this stage, it had basically clobbered the existing installation with a brand new one. -- I did some searching and found others that had this problem (http://ubuntuforums.org/showthread.php?t=1535034 and http://gallery.menalto.com/node/97041), along with some pretty strong-worded advice: nivekiam> The Ubuntu maintainers apparently don't use, test, install or even nivekiam> know of Gallery but still try to put it into their repository and screw nivekiam> it up every damn time. nivekiam> nivekiam> apt-get remove gallery2 nivekiam> nivekiam> Download and install it manually and you'll never have a problem nivekiam> with Ubuntu repository maintainers screwing up your Gallery install nivekiam> again. Wow, harsh. But I took his advice. Remedy: apt-get remove --purge gallery2, restore last night's backup of the mysql database and the photos directory, install gallery2 from a tarball from their web site, re-install all of my photos "from server", and don't rely on apt/dpkg to manage gallery2 any more. Alan