美文网首页
Ubuntu 下 Postgresql 安装

Ubuntu 下 Postgresql 安装

作者: claylee | 来源:发表于2021-03-25 12:53 被阅读0次

系统环境 :
Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-96-generic x86_64)

安装步骤

为本地apt仓库建立postgresql映射

假如不更新source文件,apt报错:"Failed to fetch ...Postgresql.....deb "

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签名文件:

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

更新 apt-get的文件列表:

sudo apt-get update

执行安装.

  • 安装最新版本
    sudo apt-get -y install postgresql
  • 或者指定版本
    sudo apt-get -y install postgresql-12

相关文章

网友评论

      本文标题:Ubuntu 下 Postgresql 安装

      本文链接:https://www.haomeiwen.com/subject/qfilhltx.html