实际上,我安装了 PostgreSQL 9.4(带有 postGIS 扩展),安装后一切正常。
正如许多人所说,我已经设置了 /data 文件夹,检查了配置文件等等。在其他项目上工作所以我有一段时间没有在 psql 上工作但是当安装完成后,它曾经正常工作,我做了一个测试数据库,初始化了 postgres 用户等。
现在,我尝试启动 psql(使用“默认”postgres 用户)但无法连接!启动/停止/重启服务不会改变任何东西...
“psql”命令的结果(使用 postgres 用户):
psql: could not connect to server: No such file or directory
Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)
当我检查服务状态时,我得到这个:
postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled)
Active: active (exited) since tue 2016-05-24 09:24:13 CEST; 3s ago
Process: 5658 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 5658 (code=exited, status=0/SUCCESS)
Run Code Online (Sandbox Code Playgroud)
使用命令启动/停止/重新启动服务
sudo service postgresql start (or restart or stop) …Run Code Online (Sandbox Code Playgroud) 我刚刚在虚拟机上安装了最新的 Debian 版本 (8.4),一切正常。
然后我从 Debian repos 安装了 nginx 服务器,我得到了 1.6.2 版,而可用的最新版本是 1.10,所以我想更新它。
我尝试这样做的方式可能是错误的,但这就是我迄今为止所发现的。
我首先通过以sources.list这种方式将 nginx 存储库添加到文件中来更新我的存储库:
sudo sh -c "echo 'deb http://nginx.org/packages/debian/ `lsb_release -cs` nginx' >> /etc/apt/sources.list"
sudo sh -c "echo 'deb-src http://nginx.org/packages/debian/ `lsb_release -cs` nginx' >> /etc/apt/sources.list"
curl http://nginx.org/keys/nginx_signing.key | apt-key add -
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)
然后,我尝试使用以下命令安装最新的 nginx 版本:
sudo apt-get install nginx
Run Code Online (Sandbox Code Playgroud)
我得到这个问题:
root@Debian:/#LANG=C apt-get install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and …Run Code Online (Sandbox Code Playgroud)