-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathstep01_ubuntu2204_pg_deps.sh
More file actions
28 lines (25 loc) · 1.18 KB
/
step01_ubuntu2204_pg_deps.sh
File metadata and controls
28 lines (25 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
PGVER=${PGVER:-pg15}
if [ "$PGVER" = "pg14" ]; then
apt-get update
apt-get -y install postgresql
service postgresql start
elif [ "$PGVER" = "pg15" ]; then
#start-recommended
apt-get install -y curl ca-certificates
install -d /usr/share/postgresql-common/pgdg
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
apt-get update
apt-get -y install postgresql-15
service postgresql start
#end-recommended
elif [ "$PGVER" = "pg16" ]; then
apt-get install -y curl ca-certificates
install -d /usr/share/postgresql-common/pgdg
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
apt-get update
apt-get -y install postgresql-16
service postgresql start
fi