Brooks Computing Systems
USA
Brooks Computing Systems - Jacksonville
Visit Brooks Computing Systems
Mainframes, Desktops & Web Sites

To install PostgreSQL on Gentoo Linux, follow these steps:

To install PostgreSQL on Gentoo Linux, follow these steps:

   sudo emerge --sync
   sudo emerge -av sys-cluster/postgresql16

Replace `postgresql16` with your desired version (e.g., `postgresql15`).


   sudo useradd -c "PostgreSQL Server" -d /var/lib/postgresql -m -s /bin/false postgres
   sudo passwd -d postgres  # Disable the postgres user's password

   sudo -u postgres initdb -D /var/lib/postgresql/data

This creates the default database directory and initializes the cluster.

Edit the configuration files:

  • **`postgresql.conf`**: Located at `/var/lib/postgresql/data/postgresql.conf`
  • **`pg_hba.conf`**: Located at `/var/lib/postgresql/data/pg_hba.conf`

Example `pg_hba.conf` to allow local connections:

   # TYPE  SOURCE     DEST      USER        CIDR-ADDRESS          METHOD
   local   all        all        postgres                             trust
   host    all        all        127.0.0.1/32  md5

   sudo rc-update add postgresql default
   sudo /etc/init.d/postgresql start

Connect to the database as the `postgres` user:

   sudo -u postgres psql -U postgres

You should see a PostgreSQL prompt (`psql (16.x) ...`).

   sudo rc-update add postgresql default
Quality, Reliability & Service        Consultancy for Mainframes, Desktops & Web Sites
Visit https://bcs.archman.us Contact Us https://bcs.archman.us/contact Languages
Thank You For Visiting
Brooks Computing Systems
USA
Brooks Computing Systems - Jacksonville
Visit Brooks Computing Systems
Mainframes, Desktops & Web Sites
Quality, Reliability & Service
Visit Visit Our Site