Ive run into same issue and although the above persons fix gets me past the collation error I still have another which will always come up regardless of how many times i run it and re launch gvm-setup. It appears as although I am root the recomended FIX does not do anything.
No LSB modules are available.
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2023.2
Codename: kali-rolling
sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database
──(root㉿kali)-[~]
└─# runuser -u postgres -- /usr/share/gvm/create-postgresql-database
could not change directory to "/root": Permission denied
[i] User _gvm already exists in PostgreSQL
could not change directory to "/root": Permission denied
[*] Creating database
could not change directory to "/root": Permission denied
createdb: error: database creation failed: ERROR: template database "template1" has a collation version mismatch
DETAIL: The template database was created using collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in the template database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
could not change directory to "/root": Permission denied
[*] Creating permissions
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
[*] Applying permissions
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
[*] Creating extension uuid-ossp
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
[*] Creating extension pgcrypto
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
[*] Creating extension pg-gvm
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
``