我想从Ubuntu12.04中删除PostgreSQL9.1
我使用apt-get remove --purge postgresql-9.1
我得到了错误的* Use of uninitialized value $info{"pgdata"} in -d at /usr/bin/pg_ctlcluster line 331.
我正确地将PGDATA="/var/lib/postgresql/data"设置为/etc/environment
其他操作(如pg_ctl stop或service postgresql stop )也会犯相同的错误
发布于 2014-09-07 14:21:54
您可以在命令行中尝试此操作:
export PGDATA=/var/lib/postgresql/data然后再尝试删除。您可能需要使用不同的-f -m组合来“忽略”错误。
apt-get remove -f -m --purge postgresql-9.1或者,作为根用户,只需删除文件即可。首先,确保没有postgres的东西正在运行(ps -ax \ grep )。在我的系统里我会:
rm -rf /var/lib/postgresql/data
rm -rf /usr/local/pgsql(小心那些rm -rf命令:-)
另一件需要清理的事情是启动和库内容:尝试:
ls /etc/*/postgr
如果你看到这样的文件:
/etc/init.d/postgresql /etc/rc2.d/S20postgresql
/etc/ld.so.conf.d/postgresql.conf /etc/rc3.d/S20postgresql
/etc/profile.d/postgres_path.sh /etc/rc4.d/S20postgresql
/etc/rc0.d/K20postgresql /etc/rc5.d/S20postgresql
/etc/rc1.d/K20postgresql /etc/rc6.d/K20postgresql接下来的步骤是只对它们进行rm:
rm -f /etc/*/*postgr*软件包的智能管理非常方便。我从来没有用它来删除包,我总是担心这是否真的会正确。祝好运。
https://stackoverflow.com/questions/25706196
复制相似问题