# Upgrade from 1.7.0 beta 5 to beta 7 failed. Postgresql error

**URL:** <https://meta.discourse.org/t/upgrade-from-1-7-0-beta-5-to-beta-7-failed-postgresql-error/53020>\
**Category:** Self-hosting\
**Created:** [Novembre 17, 2016, 11:49 UTC](https://meta.discourse.org/t/upgrade-from-1-7-0-beta-5-to-beta-7-failed-postgresql-error/53020 "2016-11-17T11:49:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)\
**Post date:** [Novembre 17, 2016, 11:49 UTC](https://meta.discourse.org/t/upgrade-from-1-7-0-beta-5-to-beta-7-failed-postgresql-error/53020/1 "2016-11-17T11:49:00Z")

</div>

It seems that we have postgresql 9.3 instead 9.5.

```plaintext
Removing postgresql-contrib-9.5 (9.5.5-1.pgdg16.04+1) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/share/postgresql/9.5/man/man1/postmaster.1.gz because link group postmaster.1.gz is broken
update-alternatives: error: error creating symbolic link '/usr/share/man/man1/postmaster.1.gz.dpkg-tmp': No such file or directory
dpkg: error processing package postgresql-contrib-9.5 (--remove):
 subprocess installed pre-removal script returned error exit status 2
dpkg: postgresql-9.5: dependency problems, but removing anyway as you requested:
 postgresql-contrib-9.5 depends on postgresql-9.5 (= 9.5.5-1.pgdg16.04+1).

Removing postgresql-9.5 (9.5.5-1.pgdg16.04+1) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of stop.
Removing postgresql-client-9.5 (9.5.5-1.pgdg16.04+1) ...
Processing triggers for postgresql-common (177.pgdg16.04+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Errors were encountered while processing:
 postgresql-contrib-9.5

FAILED
--------------------
Pups::ExecError: apt-get remove -y postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5 failed with return #<Process::Status: pid 16 exit 100>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "apt-get remove -y postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5"
6608265d4e514f4433369a755976e57faee4fc16d73eb82241baed926f4dd310
 FAILED TO BOOTSTRAP please scroll up and look for earlier error messages, there may be more than one
```

I read other topics with this error:  
[https://meta.discourse.org/t/error-message-after-rebuild-app-upgrade-of-postgres-failed/46697/2?u=trash](https://meta.discourse.org/t/error-message-after-rebuild-app-upgrade-of-postgres-failed/46697/2)  
and

> [@Errors were encountered while processing: postgresql-contrib-9.5](https://meta.discourse.org/t/errors-were-encountered-while-processing-postgresql-contrib-9-5/52670/2):
>
> A current app.yml should be using: templates: - "templates/postgres.template.yml" - "templates/redis.template.yml" - "templates/web.template.yml" - "templates/web.ratelimited.template.yml" ## Uncomment these two lines if you wish to add Lets Encrypt (https) - "templates/web.ssl.template.yml" - "templates/web.letsencrypt.ssl.template.yml" Why are you using PostgreSQL 9.3? Take a backup, fix templates, rebuild and, if needed, restore the backup.

So, just to be sure, I need to build a new container with postgresql 9.5 and, after, a new fresh installation of Discourse importing my last backup?  
Is this the correct way or I have something else to do before (or after)?

Thanks

---

_[View the full topic](https://meta.discourse.org/t/upgrade-from-1-7-0-beta-5-to-beta-7-failed-postgresql-error/53020)._
