postgress - install

debian

    cd /usr/share/keyrings/
    wget https://www.postgresql.org/media/keys/ACCC4CF8.asc
    gpg1 --dearmor < ACCC4CF8.asc > ACCC4CF8.gpg
ls -lF /etc/apt/sources.list.d/pgsql.list # no exist
cat > /etc/apt/sources.list.d/pgsql.list <<EOF
deb [signed-by=/usr/share/keyrings/ACCC4CF8.gpg] http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main
EOF
    apt update
    apt search postgres | grep -E 'postgresql-[[:digit:]]+-dbgsym'

simply get the default offered version (picks the latest one already)

    #apt install postgresql-server postgresql-client
    apt install postgresql

and check

    dpkg -l | grep postgres
    systemctl status postgresql
netstat -lntup | grep postgres

netbsd

    echo $PKG_PATH
    pkg_add postgresql12
    cp /usr/pkg/share/examples/rc.d/pgsql /etc/rc.d/
    echo pgsql=yes >> /etc/rc.conf
    /etc/rc.d/pgsql start

additional notes

otherwise if you want to proceed from scratch to avoid the Ubuntu/MSF inconsistencies – grab latest

    apt purge postgresql-common postgresql-client-common pgadmin3 pgadmin4
    rm -rf /etc/postgresql-common/
    rm -rf /var/lib/postgresql/
    dpkg -l | grep postgres
    dpkg -l | grep pgadmin

    apt install build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev git autoconf curl zlib1g-dev libxml2-dev libxslt1-dev tigervnc-viewer libyaml-dev curl zlib1g-dev ruby ruby-dev
    #xtightvncviewer

    wget https://ftp.postgresql.org/pub/snapshot/12/postgresql-12-snapshot.tar.gz
    tar xzf postgresql-12-snapshot.tar.gz
    cd postgresql-12.2/
    ./configure
    grep ^proc /proc/cpuinfo
    make -j4
    make install

    #mkdir /usr/local/pgsql/data/
    #chown postgres:postgres /usr/local/pgsql/data/
    mkdir /var/lib/postgresql/
    chown postgres:postgres /var/lib/postgresql/

    su - postgres
    vi .bash_profile

    export PATH=/usr/local/pgsql/bin:$PATH

    source .bash_profile
    initdb -D /var/lib/postgresql/data
pg_ctl -D /var/lib/postgresql/data -l logfile start
    ^D

check

    netstat -lntup

HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun