我在运行一个AWS Ubuntu图像。
为了设置我的机器,我玩了apt-get来添加和删除PostgreSql及其一些模块。
现在,当我运行sudo apt-get install postgresql-9.3时,会得到以下错误:
Setting up postgresql-9.3 (9.3.10-0ubuntu0.14.04) ...
update-alternatives: using /usr/share/postgresql/9.3/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
* Starting PostgreSQL 9.3 database server * Error: could not exec /usr/lib/postgresql/9.3/bin/pg_ctl /usr/lib/postgresql/9.3/bin/pg_ctl start -D /var/lib/postgresql/9.3/main -s -o -c config_file="/etc/postgresql/9.3/main/postgresql.conf" : No such file or directory唯一缺少的文件/目录是/var/lib/postgresql/9.3/main
我试过:
sudo apt-get remove postgresql-9.3删除postgresql并重新安装它错误仍然发生。
我做错了什么?我怎么才能解决这个问题?
发布于 2016-02-09 07:22:40
我的理解是,您在卸载时删除了群集,并且它不会自动重新创建。
重新创建集群应该可以解决这个问题:
mkdir /var/lib/postgresql/9.3/main
chown postgres /var/lib/postgresql/9.3/main
su postgres
/usr/lib/postgresql/9.3/bin/pg_ctl -D /var/lib/postgresql/9.3/main initdb您可能需要用在ubuntu上使用的数据库用户帐户替换postgres。
查看postgres手册以获得更多信息:http://www.postgresql.org/docs/current/static/creating-cluster.html
https://serverfault.com/questions/754908
复制相似问题