I want to update my postgresql13.6 to latest one (15.3 for now). Steps I followed :
- I'm using AWS, I create Image from the instance[ ubuntu ] (runs postgresql 13.6)
- From AMIs, I launch a new instance
- Postgresql 13.6 is working fine
- I used the below command to update the latest version
-> sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
-> wget --quiet -O - https://www.pos tgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
-> sudo apt-get update
-> sudo apt-get -y install postgresql
After this, I get the errors below :
Creating new PostgreSQL cluster 15/main ...
/usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/15/main --auth-local peer --auth-host scram-sha-256 --no-instructions
/usr/lib/postgresql/15/bin/initdb: symbol lookup error: /usr/lib/postgresql/15/bin/initdb: undefined symbol: PQmblenBounded
Error: initdb failed
Error: could not create default cluster. Please create it manually with
Here are details output :
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libllvm11 linux-aws-5.4-headers-5.4.0-1072 linux-aws-5.4-headers-5.4.0-1075 linux-aws-5.4-headers-5.4.0-1078 linux-aws-5.4-headers-5.4.0-1080 linux-aws-5.4-headers-5.4.0-1081 linux-aws-5.4-headers-5.4.0-1083 linux-aws-5.4-headers-5.4.0-1084
linux-aws-5.4-headers-5.4.0-1085 linux-aws-5.4-headers-5.4.0-1086 linux-aws-5.4-headers-5.4.0-1088 linux-aws-5.4-headers-5.4.0-1089 linux-aws-5.4-headers-5.4.0-1092 linux-aws-5.4-headers-5.4.0-1093 linux-aws-5.4-headers-5.4.0-1094 linux-aws-5.4-headers-5.4.0-1097
linux-aws-5.4-headers-5.4.0-1099 percona-postgresql-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
postgresql-client-15
Suggested packages:
postgresql-doc-15
The following NEW packages will be installed:
postgresql-15 postgresql-client-15
0 upgraded, 2 newly installed, 0 to remove and 42 not upgraded.
Need to get 17.7 MB of archives.
After this operation, 59.7 MB of additional disk space will be used.
Get:1 http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main amd64 postgresql-client-15 amd64 15.3-1.pgdg18.04+1 [1688 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main amd64 postgresql-15 amd64 15.3-1.pgdg18.04+1 [16.0 MB]
18% [2 postgresql-15 12.1 kB/16.0 MB 0%]
Fetched 17.7 MB in 6s (3012 kB/s)
Preconfiguring packages ...
Selecting previously unselected package postgresql-client-15.
(Reading database ... 434820 files and directories currently installed.)
Preparing to unpack .../postgresql-client-15_15.3-1.pgdg18.04+1_amd64.deb ...
Unpacking postgresql-client-15 (15.3-1.pgdg18.04+1) ...
Selecting previously unselected package postgresql-15.
Preparing to unpack .../postgresql-15_15.3-1.pgdg18.04+1_amd64.deb ...
Unpacking postgresql-15 (15.3-1.pgdg18.04+1) ...
Setting up postgresql-client-15 (15.3-1.pgdg18.04+1) ...
update-alternatives: using /usr/share/postgresql/15/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-15 (15.3-1.pgdg18.04+1) ...
Creating new PostgreSQL cluster 15/main ...
/usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/15/main --auth-local peer --auth-host scram-sha-256 --no-instructions
/usr/lib/postgresql/15/bin/initdb: symbol lookup error: /usr/lib/postgresql/15/bin/initdb: undefined symbol: PQmblenBounded
Error: initdb failed
Error: could not create default cluster. Please create it manually with
pg_createcluster 15 main --start
or a similar command (see 'man pg_createcluster').
update-alternatives: using /usr/share/postgresql/15/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
Processing triggers for postgresql-common (1:241-4.bionic) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
FYI, I can successfully update it using a fresh instance
Try 1. I tried with a new instance installed 13 then created some test db, and inserts a few data into a table. Then update 15, I can see all data - Success Try 2. I tried with a new instance installed 13 then created an Image and launch a new instance using this image (AMIs) and updated. Then update 15, I can see all data of version 13 - Success