美文网首页
Ubuntu20.04安装postgis

Ubuntu20.04安装postgis

作者: 一个前端程序员 | 来源:发表于2020-09-14 13:36 被阅读0次

    1、新建/etc/apt/sources.list.d/pgdg.list

    deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main
    // lsb_release -cs 查看当前系统的分发版本
    deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main // #20.04 ->focal
    

    或 一步操作

    echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
    

    2、导入存储库签名密钥

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

    3、更新程序包列表

    sudo apt update
    

    4、安装

    sudo apt install postgresql-9.5 postgresql-9.5-postgis-2.5 postgis 
    

    5、配置/etc/postgresql/9.5/main/postgresql.conf /etc/postgresql/9.5/main/pg_hba.conf

    postgresql.conf -> port=5432 listen_addresses =  '*'
    pg_hba.conf -> host    all             all             0.0.0.0/0               trust
    

    6、重启postgresql服务

    sudo service postgresql restart
    

    相关文章

      网友评论

          本文标题:Ubuntu20.04安装postgis

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