Gary,what is happening is that you have the postgresql metapackage installed. From time to time, this package is updated to depend on the supported postgresql (e.g. postgresql-9.6). If you remove postgresql and just install (e.g.) postgresql-9.6, the installation of new versions will cease.
Installing postgresql-9.X will not automatically upgrade an existing cluster, should leave an existing cluster on port 5432, and will install new services in parallel on a new port.
It should be safe to remove unused postgresql-9.x packages. A simulated removal with "apt-get purge -s" will report whether unrelated packages depend on any particular package. Be very sure that you remove the right package. Purge will also remove your data, I think; you can use "apt-get remove" if you do not mind residual mess. Have good backups.
You should also consider migrating to the latest version (supported), but there are often changes that break applications, so check compatibility before upgrading, or test with the new one (this is where parallel postgresql installations shine):
https://www.postgresql.org/docs/9.0/static/migration.html https://www.postgresql.org/docs/9.2/static/upgrading.html Kind regards, Ben. On 25/10/16 07:10, Gary Roach wrote:
Hi all, I have been having trouble with my django development project finding the postgresql database. In the process of looking for the source of the problem I found that there are versions of postgresql installed for 9.1 through 9.6 . Are all of these copies necessary and can I safely remove all of the ones that I am not using for my project or are there other packages on the system that are using those. Debian Stretch with KDE desktop Gary R.
-- Ben Caradoc-Davies <ben@transient.nz> Director Transient Software Limited <http://transient.nz/> New Zealand