每当我使用以下命令安装postgreSQL服务器时,我都会尝试安装并运行它
sudo apt-get install postgresql
我得到以下错误:
* Starting PostgreSQL 9.1 database server
* The PostgreSQL server failed to start. Please check the log output:
2014-04-03 17:18:16 PDT FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied
[fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-9.1:
postgresql-9.1 depends on postgresql-common (>= 115~); however:
Package postgresql-common is not configured yet.
dpkg: error processing postgresql-9.1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-9.1; however:
Package postgresql-9.1 is not configured yet.
dpkg: error processing postgresql (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while
processing:
postgresql-common
postgresql-9.1
postgresql
E: Sub-process /usr/bin/dpkg returned an error code (1)
我猜这是一个权限问题;我该如何着手解决它?我正在运行Ubuntu 13.10
发布于 2014-05-14 13:04:37
更改/var/run/postgresql
的所有者并将其设置为postgres
sudo chown -R postgres:postgres /var/run/postgresql
如果正在运行的用户没有sudo权限,则
将
su -
/var/run/postgresql
的所有权更改为用户postgres
和组postgres
:/var/run/postgresql -R postgres: chown
当我在Ubuntu14.04上安装postgres
并更改所有权时,我也遇到了同样的问题,并为我解决了这个问题。
发布于 2015-09-02 06:12:54
锁文件在/var/run
中结束。要修复此目录的权限,我需要运行sudo chmod a+w /var/run/postgresql
。
发布于 2014-04-04 08:38:49
您可以检查/var/run的文件权限吗?
ls -l /var/run
如果缺少“write”权限,请尝试
sudo chmod o+w /var/run
https://stackoverflow.com/questions/22851352
复制相似问题