GVM Setup Kali 2023.2

I built fresh kali distro ran apt update && apt upgrade checked for distro updates etc all updated then ran apt-install openvas along with gvm-setup. I then ran gvm-check-setup which gives me this
vm-check-setup
gvm-check-setup 22.5.0
Test completeness and readiness of GVM-22.5.0
Step 1: Checking OpenVAS (Scanner)…
OK: OpenVAS Scanner is present in version 22.7.3.
OK: Notus Scanner is present in version 22.5.0.
OK: Server CA Certificate is present as /var/lib/gvm/CA/servercert.pem.
Checking permissions of /var/lib/openvas/gnupg/*
OK: _gvm owns all files in /var/lib/openvas/gnupg
OK: redis-server is present.
OK: scanner (db_address setting) is configured properly using the redis-server socket: /var/run/redis-openvas/redis-server.sock
OK: the mqtt_server_uri is defined in /etc/openvas/openvas.conf
OK: _gvm owns all files in /var/lib/openvas/plugins
OK: NVT collection in /var/lib/openvas/plugins contains 86045 NVTs.
OK: The notus directory /var/lib/notus/products contains 434 NVTs.
Checking that the obsolete redis database has been removed
OK: No old Redis DB
OK: ospd-openvas service is active.
OK: ospd-OpenVAS is present in version 22.5.3.
Step 2: Checking GVMD Manager …
OK: GVM Manager (gvmd) is present in version 22.5.5.
Step 3: Checking Certificates …
OK: GVM client certificate is valid and present as /var/lib/gvm/CA/clientcert.pem.
OK: Your GVM certificate infrastructure passed validation.
Step 4: Checking data …
OK: SCAP data found in /var/lib/gvm/scap-data.
OK: CERT data found in /var/lib/gvm/cert-data.
Step 5: Checking Postgresql DB and user …
OK: Postgresql version and default port are OK.
ERROR: The Postgresql DB does not exist.
FIX: Run ‘sudo runuser -u postgres – /usr/share/gvm/create-postgresql-database’

ERROR: Your GVM-22.5.0 installation is not yet complete!

Please follow the instructions marked with FIX above and run this
script again.

I run the above FIX and get the following

└─# sudo 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

WTH do I do now???

Duplicate of

3 Likes