PostgreSQL数据库是一个高性能的全功能的开源关系型数据库,这里讲解一下如何在Ubuntu 16.04 LTS 下安装 PostgreSQL 10。

添加软件源

wget -q -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

更新本地缓存

apt update

安装

lwk@qwfys ~ $ apt install postgresql-10 -y

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages were automatically installed and are no longer required:

bbswitch-dkms lib32gcc1 libc6-i386 libjansson4 libvdpau1 libxnvctrl0 screen-resolution-extra xserver-xorg-legacy

Use 'sudo apt autoremove' to remove them.

The following additional packages will be installed:

libjs-underscore libpq5 libwxbase3.0-0v5 libwxgtk3.0-0v5 pgadmin3-data pgdg-keyring postgresql-client-10 postgresql-client-common postgresql-common

Suggested packages:

javascript-common postgresql-contrib locales-all postgresql-doc-10 libjson-perl

Recommended packages:

pgagent sysstat

The following NEW packages will be installed:

libjs-underscore libwxbase3.0-0v5 libwxgtk3.0-0v5 pgadmin3 pgadmin3-data pgdg-keyring postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common

The following packages will be upgraded:

libpq5

1 upgraded, 10 newly installed, 0 to remove and 1 not upgraded.

Need to get 17.3 MB of archives.

After this operation, 70.0 MB of additional disk space will be used.

Get:1 http://mirrors.ustc.edu.cn/ubuntu xenial/main amd64 libjs-underscore all 1.7.0~dfsg-1ubuntu1 [46.7 kB]

Get:2 http://mirrors.ustc.edu.cn/ubuntu xenial-updates/universe amd64 libwxbase3.0-0v5 amd64 3.0.2+dfsg-1.3ubuntu0.1 [971 kB]

Get:3 http://mirrors.ustc.edu.cn/ubuntu xenial-updates/universe amd64 libwxgtk3.0-0v5 amd64 3.0.2+dfsg-1.3ubuntu0.1 [4,344 kB]

Get:4 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 libpq5 amd64 10.1-1.pgdg16.04+1 [157 kB]

Get:5 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 pgadmin3-data all 1.22.2-2.pgdg16.04+1 [2,516 kB]

Get:6 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 pgadmin3 amd64 1.22.2-2.pgdg16.04+1 [3,067 kB]

Get:7 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 pgdg-keyring all 2017.3 [10.3 kB]

Get:8 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-client-common all 188.pgdg16.04+1 [81.5 kB]

Get:9 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-client-10 amd64 10.1-1.pgdg16.04+1 [1,277 kB]

Get:10 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-common all 188.pgdg16.04+1 [220 kB]

Get:11 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-10 amd64 10.1-1.pgdg16.04+1 [4,635 kB]

Fetched 17.3 MB in 6min 12s (46.5 kB/s)

Preconfiguring packages ...

Selecting previously unselected package libjs-underscore.

(Reading database ... 210818 files and directories currently installed.)

Preparing to unpack .../libjs-underscore_1.7.0~dfsg-1ubuntu1_all.deb ...

Unpacking libjs-underscore (1.7.0~dfsg-1ubuntu1) ...

Preparing to unpack .../libpq5_10.1-1.pgdg16.04+1_amd64.deb ...

Unpacking libpq5:amd64 (10.1-1.pgdg16.04+1) over (9.5.10-0ubuntu0.16.04) ...

Selecting previously unselected package libwxbase3.0-0v5:amd64.

Preparing to unpack .../libwxbase3.0-0v5_3.0.2+dfsg-1.3ubuntu0.1_amd64.deb ...

Unpacking libwxbase3.0-0v5:amd64 (3.0.2+dfsg-1.3ubuntu0.1) ...

Selecting previously unselected package libwxgtk3.0-0v5:amd64.

Preparing to unpack .../libwxgtk3.0-0v5_3.0.2+dfsg-1.3ubuntu0.1_amd64.deb ...

Unpacking libwxgtk3.0-0v5:amd64 (3.0.2+dfsg-1.3ubuntu0.1) ...

Selecting previously unselected package pgadmin3-data.

Preparing to unpack .../pgadmin3-data_1.22.2-2.pgdg16.04+1_all.deb ...

Unpacking pgadmin3-data (1.22.2-2.pgdg16.04+1) ...

Selecting previously unselected package pgadmin3.

Preparing to unpack .../pgadmin3_1.22.2-2.pgdg16.04+1_amd64.deb ...

Unpacking pgadmin3 (1.22.2-2.pgdg16.04+1) ...

Selecting previously unselected package pgdg-keyring.

Preparing to unpack .../pgdg-keyring_2017.3_all.deb ...

Unpacking pgdg-keyring (2017.3) ...

Selecting previously unselected package postgresql-client-common.

Preparing to unpack .../postgresql-client-common_188.pgdg16.04+1_all.deb ...

Unpacking postgresql-client-common (188.pgdg16.04+1) ...

Selecting previously unselected package postgresql-client-10.

Preparing to unpack .../postgresql-client-10_10.1-1.pgdg16.04+1_amd64.deb ...

Unpacking postgresql-client-10 (10.1-1.pgdg16.04+1) ...

Selecting previously unselected package postgresql-common.

Preparing to unpack .../postgresql-common_188.pgdg16.04+1_all.deb ...

Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'

Unpacking postgresql-common (188.pgdg16.04+1) ...

Selecting previously unselected package postgresql-10.

Preparing to unpack .../postgresql-10_10.1-1.pgdg16.04+1_amd64.deb ...

Unpacking postgresql-10 (10.1-1.pgdg16.04+1) ...

Processing triggers for libc-bin (2.23-0ubuntu9) ...

Processing triggers for doc-base (0.10.7) ...

Processing 1 added doc-base file...

Registering documents with scrollkeeper...

Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...

Processing triggers for desktop-file-utils (0.22+linuxmint1) ...

Processing triggers for mime-support (3.59ubuntu1) ...

Processing triggers for man-db (2.7.5-1) ...

Processing triggers for systemd (229-4ubuntu21) ...

Processing triggers for ureadahead (0.100.0-19) ...

ureadahead will be reprofiled on next reboot

Setting up libjs-underscore (1.7.0~dfsg-1ubuntu1) ...

Setting up libpq5:amd64 (10.1-1.pgdg16.04+1) ...

Setting up libwxbase3.0-0v5:amd64 (3.0.2+dfsg-1.3ubuntu0.1) ...

Setting up libwxgtk3.0-0v5:amd64 (3.0.2+dfsg-1.3ubuntu0.1) ...

Setting up pgadmin3-data (1.22.2-2.pgdg16.04+1) ...

Setting up pgadmin3 (1.22.2-2.pgdg16.04+1) ...

Setting up pgdg-keyring (2017.3) ...

Removing apt.postgresql.org key from trusted.gpg: OK

Setting up postgresql-client-common (188.pgdg16.04+1) ...

Setting up postgresql-client-10 (10.1-1.pgdg16.04+1) ...

update-alternatives: using /usr/share/postgresql/10/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode

Setting up postgresql-common (188.pgdg16.04+1) ...

Adding user postgres to group ssl-cert

Creating config file /etc/postgresql-common/createcluster.conf with new version

Building PostgreSQL dictionaries from installed myspell/hunspell packages...

en_us

Removing obsolete dictionary files:

Setting up postgresql-10 (10.1-1.pgdg16.04+1) ...

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Unescaped left brace in regex is deprecated, passed through in regex; marked by

Creating new PostgreSQL cluster 10/main ...

/usr/lib/postgresql/10/bin/initdb -D /var/lib/postgresql/10/main --auth-local peer --auth-host md5

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.

The database cluster will be initialized with locales

COLLATE: en_US.UTF-8

CTYPE: en_US.UTF-8

MESSAGES: en_US.UTF-8

MONETARY: zh_CN.UTF-8

NUMERIC: zh_CN.UTF-8

TIME: en_US.UTF-8

The default database encoding has accordingly been set to "UTF8".

The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/10/main ... ok

creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers ... 128MB

selecting dynamic shared memory implementation ... posix

creating configuration files ... ok

running bootstrap script ... ok

performing post-bootstrap initialization ... ok

syncing data to disk ... ok

Success. You can now start the database server using:

/usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l logfile start

Ver Cluster Port Status Owner Data directory Log file

10 main 5432 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

update-alternatives: using /usr/share/postgresql/10/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode

Processing triggers for libc-bin (2.23-0ubuntu9) ...

Processing triggers for systemd (229-4ubuntu21) ...

Processing triggers for ureadahead (0.100.0-19) ...

pg10 10.3 1 linux64,Install Postgresql 10 In Ubutnu 16.04 LTS相关推荐

  1. Ubuntu 16.04 安装第三方Apps Can’t Install Third-Party Apps on Ubuntu 16.04? You’re No

    Having trouble installing third-party .debs on Ubuntu 16.04? You, my friend, are far from alone. A h ...

  2. How to install PostgreSql 10 to Fedora 27

    国庆之后,云栖大会杭州分会上相关专家做了一个关于Postgresql的专题分享,其中提到了Postgresql 10的一些新特性,个人感觉倍受鼓舞,接下来希望分别针对Ubuntu 16.04LTS和F ...

  3. Install PostgreSql 10 to Fedora 27

    国庆之后,云栖大会杭州分会上相关专家做了一个关于Postgresql的专题分享,其中提到了Postgresql 10的一些新特性,个人感觉倍受鼓舞,接下来希望分别针对Ubuntu 16.04LTS和F ...

  4. 在macOS Sierra 10.12.3下用VMware Fusion安装Ubuntu 16.04.2

    先抱怨一下,在mac上安装linux不是小编的本意. 被逼的~被逼的~ 不知是人品太差,还是运气太差? 同一个软件包(好了,就是那PBRT-V3),之前在Linux编译.调试都是OK的. 还是那个包, ...

  5. PostgreSQL 分区表, pg_pathman ,PostgreSQL 10介绍及性能对比(转载)

    转载自:https://my.oschina.net/yonj1e/blog/868402 PostgreSQL 分区表, pg_pathman ,PostgreSQL 10介绍及性能对比 原 yon ...

  6. How to Install MariaDB 10 on CentOS 6.7

    为什么80%的码农都做不了架构师?>>>    1. Add the Official MariaDB Yum Repository First off, we need to ad ...

  7. ubuntu 16.04(Windows 10双系统+grub引导)无法进入tt1~tt6(NVIDIA驱动安装相关-黑屏,login loop,分辨率)...

    目录 前言回顾 最终解决: 0.关闭x服务 1.禁用nouveau 2.加入 3.更新 4.查找匹配驱动 5.选择推荐版本 6.等待安装后重启,nvidia-smi查看是否安装成功,或者lsmod | ...

  8. linux双系统安装nvidia,ubuntu 16.04(Windows 10双系统+grub引导)无法进入tt1~tt6(NVIDIA驱动安装相关-黑屏,login loop,分辨率)...

    [toc] 前言回顾 Ubuntu 16.04 LTS + Windows 10双系统(notebook) 显卡:GeForce GTX 950M 集显+独显 所有不说环境的教程都是耍流氓啊QWQ, ...

  9. Ubuntu 15.10/16.04 上安装Caffe——确保编译好的库相互兼容

    前言:     在Ubuntu14.04 LTS版本上编译安装Caffe的教程非常多,安装过程也较为顺利,然而在更新版本系统上编译安装Caffe的过程中,仍会遇到很多问题.其中,在make过程中遇到u ...

最新文章

  1. Spark Troubleshooting - Task not serializable问题分析
  2. 技术型产品经理与系统设计
  3. mysql忘记root密码咋办_MySQL忘记root用户密码怎么办?
  4. AX 2009 界面伸缩功能
  5. 会议交流 | 最新NLP核心技术与前沿实践分享!
  6. mysql 正则 换行符_MySQL 正则表达式
  7. uni-app入门到项目实战
  8. android找不到华为推送,Android 华为推送 android 10.0 获取不到token
  9. 删除设备和驱动器下图标
  10. 纯真IP库详解(转)
  11. 如何通过提问识人(行为面试法)
  12. js获取图片点坐标值
  13. omap4430驱动
  14. 抓包工具fiddler使用与理论的理解
  15. OpenCV-文字绘制cv::putText
  16. 液晶显示屏划痕修复方法
  17. android 空间动态,Android手机QQ空间新版:玩转GIF动态说说
  18. 浮点数美丽的表象(为什么要慎用浮点数)
  19. P2P 终结者 for Linux
  20. 安排,Mycat教程-分布式数据库中间件课程

热门文章

  1. arm中断保护和恢复_嵌入式ARM系统异常和中断处理知识总结
  2. java 素数乘积,求助2424379123 = 两个素数的乘积,求这两个素数?
  3. workerman高并发异步mysql_workerman怎么实现高并发
  4. python 桌面提醒_使用Python获取桌面通知
  5. 编写了html怎么测试,如何将测试结果写入HTMLTestRunner生成的报告标题中
  6. JDBC实现图书管理小案例
  7. EntityManager的使用
  8. php解析js的 arraybuffer_JS的所谓的第七种数据类型Symbol
  9. 熔断器熔断时间标准_一种熔断器熔断时间测试电路的制作方法
  10. [2021-ICCV] MUSIQ Multi-scale Image Quality Transformer 论文简析