HOWTO: Recover from a bad Upgrade from Ubuntu 10.04 to 12.04

While trying to migrate a server from Ubuntu 10.04 to 12.04 today, something went wrong. Upgrading to gcc-4.4 had unmet dependencies. While, trying to solve those, gcc wanted to be installed on a newer version of the kernel, but 1and1.com doesn’t let you upgrade your kernel and so I was left in 1/2 upgraded state with no way up.

It took a while to find a method to downgrade that worked, but then I finally found http://askubuntu.com/questions/49869/how-to-roll-back-ubuntu-to-a-previous-version. The key was to use /etc/apt/preferences to prefer packages at 10.04.

HOWTO: Symfony 1.4 – Only load an plugin for a given application

Sometimes you’ll want to include a plugin, such as an admin generator, that will load stylesheets or javascript files that you may not want loaded in all applications.

You could add the following to your template file: (apps/frontend/templates/layout.php)

$sf_response->removeStylesheet('/m14tAdminGeneratorPlugin/css/admin.css');

But that just feels wrong. So instead, lets only load the plugin for the application that we want (config/ProjectConfiguration.class.php):

class ProjectConfiguration extends sfProjectConfiguration {
  public function setup() {
    $this->enablePlugins('sfDoctrinePlugin');
    ...
    if ( "admin" == sfConfig::get('sf_app') ) {
      $this->enablePlugins('m14tAdminGeneratorPlugin');
    }
  }
}