无法从 Ubuntu 14.04 卸载 PostgreSQL 9.3,除非安装 PostgreSQL 10

无法从 Ubuntu 14.04 卸载 PostgreSQL 9.3,除非安装 PostgreSQL 10

我刚刚将 Postgres 实例从 9.3 升级到 9.6,一切都运行正常,直到我尝试卸载 9.3。在删除 9.3 期间,Apt 尝试安装 Postgres 10。9.6 需要保留原样。如果我不删除 9.3,这不是世界末日,但我希望能稍微清理一下。

sudo apt-get remove postgresql-9.3返回此:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  comerr-dev krb5-multidev libgssrpc4 libkadm5clnt-mit9 libkadm5srv-mit9
  libkdb5-7 libossp-uuid16
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  postgresql postgresql-10 postgresql-client-10 postgresql-contrib
Suggested packages:
  postgresql-doc locales-all postgresql-doc-10
The following packages will be REMOVED:
  postgresql-9.3 postgresql-contrib-9.3
The following NEW packages will be installed:
  postgresql-10 postgresql-client-10
The following packages will be upgraded:
  postgresql postgresql-contrib
2 upgraded, 2 newly installed, 2 to remove and 216 not upgraded.
Need to get 6,318 kB of archives.
After this operation, 15.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]

我还没有找到在不安装 postgresql-10 的情况下删除 postgresql-9.3 的方法。提前致谢,我希望这只是因为不知道正确的 Apt 命令而导致的简单问题。

答案1

尝试执行 postgress 文件夹内的卸载脚本。

就我而言:

sudo chmod +x /opt/PostgreSQL/version_here/uninstall-postgresql sudo ./opt/PostgreSQL/version_here/uninstall-postgresql

相关内容