title: How to upgrade PostgreSQL with PostGIS?
body: <p>I was running PostgreSQL 9.1 and I am trying to upgrade to PostgreSQL 9.3:</p>
  
  <blockquote>
    <p>$ /usr/lib/postgresql/9.3/bin/pg_upgrade -b
    /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d
    /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O "-c
    config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c
    config_file=/etc/postgresql/9.1/main/postgresql.conf"</p>
  </blockquote>
  
  <p>However it fails with:</p>
  
  <blockquote>
    <p>Checking for presence of required libraries                 fatal</p>
    
    <p>Your installation references loadable libraries that are missing from
    the new installation.  You can add these libraries to the new
    installation, or remove the functions using them from the old
    installation.  A list of problem libraries is in the file:
        loadable_libraries.txt</p>
  </blockquote>
  
  <p><code>loadable_libraries.txt</code> contains:</p>
  
  <blockquote>
    <p>Could not load library "$libdir/postgis-1.5" ERROR:  could not access
    file "$libdir/postgis-1.5": No such file or directory</p>
  </blockquote>
  
  <p>It is similar to <a href="https://stackoverflow.com/questions/19597502/missing-libraries-when-upgrading-to-postgis-2-1-and-postgresql-9-3-1-using-homeb">Missing libraries when upgrading to PostGIS 2.1 and PostgreSQL 9.3.1 using homebrew</a>.</p>
  
  <p>I am running Ubuntu and I have install PostgreSQL with PostGIS using <code>apt-get</code>.</p>
  
  <p>Anyone managed that?</p>