Unable to install postgresql-client client on AWS Cloud Shell

3.6k Views Asked by At

I'm trying to install postgresql client from AWS Cloud shell, however getting below error:

Preparing your terminal...
Failed to open session : Timed out while opening the session
Trying to open session (Retrying. Attempt #1)
Connection is lost. Please refresh the browser to re-establish the connection.
[cloudshell-user@ip$ Try these commands to get started:
aws help  or  aws <command> help  or  aws <command> --cli-auto-prompt
[cloudshell-user@ip$ sudo apt install postgresql-client
sudo: apt: command not found
[cloudshell-user@ip$ 

I'm using the below command to install the postgresql client.

sudo apt install postgresql-client.

is there any way we could connect AWS RDS PostgreSQL from AWS Cloud Shell ? Like in GCP Cloud Shell ? When i try to connect from GCP Cloud shell, it allows me without any issues but the problem persists in the AWS cloud shell.

Appreciate your help.

1

There are 1 best solutions below

1
Aryeh Leib Taurog On

cloudshell runs on Amazon Linux 2, which is based on centos or redhat enterprise linux. It is not a debian-based system, so you will not find apt and friends.

You could try installing with yum, but you are probably best-off with the amazon-specific tooling:

sudo amazon-linux-extras install postgresql14

currently versions 11, 12, 13, and 14 are available