Senin, 15 September 2025

PSQL10-ubuntu22.04

 

Getting packages on Ubuntu distributions

https://medium.com/yavar/install-and-configure-postgresql-and-pgadmin-on-ubuntu-20-04-22-04-52c52c249b9e

You can go to the PostgreSQL downloads page website or download the packages using the below command:

sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Update and Upgrade Ubuntu

Before installation process, it’s always a good practice to ensure that your system is up to date.
Open a terminal and run the following commands:

sudo apt update
sudo apt upgrade

Install PostgreSQL

To install latest PostgreSQL, use the following command:

# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
sudo apt install postgresql-10

Configure PostgreSQL

By default, PostgreSQL creates a user named “postgres.” Switch to this user and access the PostgreSQL prompt:

sudo -i -u postgres
psql

Check PostgreSQL version

You can use the PostgreSQL version command to check the currently installed version.

SELECT version();

Tidak ada komentar:

Posting Komentar