1.Ctrl+Alt+t 打开终端
2.输入:wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
3.输入:sudo gedit /etc/apt/sources.list
4.在打开的文件最后面添加:deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
5.输入:sudo apt-get update
6.输入:sudo apt-get install postgresql-9.3
7.回到根目录,输入:etc/init.d/postgresql start 开启服务。