下面是步骤,在Ubuntu 14.04安装PostgreSQL 9.4。
Reference taken from this Article:
首先,检查的Ubuntu版本:
lsb_release -sc
您需要添加最新的PostgreSQL库最新的版本,否则将安装PostgreSQL 9.3。这是可靠的版本。
sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
更新和安装PostgreSQL 9.4:
sudo apt-get update
sudo apt-get install postgresql-9.4
默认的Postgres超级用户和Postgres数据库中创建。您需要为postgres超级用户设置密码。
[email protected]:~$ sudo passwd postgres
Enter new UNIX password:****
Retype new UNIX password:****
passwd: password updated successfully
如果服务没有启动,就可以启动PostgreSQL服务。
sudo service postgresql start
连接的PostgreSQL使用服务器postgres用户:
[email protected]:~$ su postgres
Password:****
创建一个示例数据库:
createdb database_name
连接到该数据库:
psql -d database_name
感谢@Schwern后返回这一点,我有错误的代号也是非常有用的。 – speg
请参阅http://www.unixmen.com/install-postgresql-9-4-phppgadmin-ubuntu-14-10/ – Natim
https://wiki.postgresql.org/wiki/Apt#Quickstart上的脚本用于我。 https://alioth.debian.org/scm/loggerhead/pkg-postgresql/postgresql-common/trunk/download/head:/apt.postgresql.org.s-20130224224205-px3qyst90b3xp8zj-1/apt.postgresql.org.sh – Abdo