I encountered the error about pg-gvm extension after i run gvm-setup in kali linux as follow:
*] Creating extension pg-gvm
ERROR: extension “pg-gvm” is not available
DETAIL: Could not open extension control file “/usr/share/postgresql/16/extension/pg-gvm.control”: No such file or directory.
HINT: The extension must first be installed on the system where PostgreSQL is running.
I already attempt to create pg-gvm extension from postgresql command but it give the same error output as stated above. Can i know what is the alternate way to install pg-gvm extension?
FYI i already run apt update and update everything to the latest version in kali
It seems that the Kali native GVM installation packages have started using PostgreSQL 16 instead of PostgreSQL 15. However, I guess that Greenbone’s postgres extensions are not tested against PostgreSQL 16. You can report the bug to Kali linux here: My View - Kali Linux Bug Tracker
In the meantime, you can fix by modifying the file /usr/share/gvmd/postgresql-version and change 16.0 to 15.0. Then gvm-setup should work properly for you.
Hi, this solution does not work for me. Installing OpenVAS on Kali 2023.3 is a pain at the moment. Tried different tips on postgresql but did not get it working.
Thanks for your help. It work. I change the openvas config to use postgresql 15 instead of 16 and now gvm-setup can work perfectly fine in my kali linux
Doing manual changes on files like this is always a little bit risky as you might e.g. keep running an old and not updated PosgreSQL database on your system
For upgrading PostgreSQL from 15 to 16 manual user action is always required as this is AFAICT not done automatically. And when not doing these steps the user is left behind with unsupported and unmaintained PostgreSQL server packages which has even security implications.
See the following posts below for a few additional notes. I had suggested to ask the Kali team (or even Debian as Kali is AFAICT also only taking the PostgreSQL packages from Debian) for better documentation around this topic as users seems to struggle quite often with this (Greenbone software unrelated) administrative tasks.
Sorry that I am new here when trying to install openvas in latest Kali. and I am having the same issue here.
I did the update and full-upgrade via apt. But the gvm-setup still gives me:
Creating extension pg-gvm
ERROR: extension “pg-gvm” is not available
DETAIL: Could not open extension control file “/usr/share/postgresql/16/extension/pg-gvm.control”: No such file or directory.
What exact steps I shall do to fix this issue? I have been struggling on this issue for many days.
I think this is because the Kali maintainers do not maintain separate install scripts for older versions of Kali Rolling. Typically, since Kali isn’t considered a long-term-support LTS operating system when new versions of Kali are released, or when upgrades to packages come out, only the leading Greenbone install scripts are kept.
Something that works for me:
edit /usr/share/gvmd/postgresql-version and change for 15.0
check your clusters and if you have 16 and 15 delete the 16
then restart the service with pg_ctlcluster 15 main restart
the last step you should be able to execute gvm-setup
COMMANDS:
sudo vim /usr/share/gvmd/postgresql-version
sudo pg_lsclusters
sudo pg_dropcluster 16 main --stop
sudo pg_ctlcluster 15 main restart
sudo gvm-setup
Instead the current older version (in this case 15) should be “upgraded” to the more recent version (in this case 16) and then packages for the older version should be dropped completely.
Please see the following for more information and raise an issue on https://bugs.kali.org if the problem persists so that the Kali packaging team can investigate.
Hi,
I had the same issue on Kali and fixed-it, (i’m using Postgresql 16 not 15, using 15 isn’t advised)
I had to install pg-gvm via github :
It ran into an additional error wich i can’t recall when using cmake to compile via github. You’ll find a way through, remember to use journalctl -u gvmd.service to look for logs if you are stuck.
After sucessfully installing pg-gvm, i had to go to the postgresql prompt and create the extention. then gvm-stop > gvm-start for changes to apply. Then i was able to login to the gvm web interface without issues.
Sorry for not giving much details, i can’t recall all the steps, but journalctl -u does a wonderfull job when it comes to finding out the source of an issue.
I’m experiencing the same problem with the postgre 16 already installed, and Kali on version 6.3.0. Even after perform apt update $$ apt upgrade. Does anyone knows how to fix this?
I found the answer: I executed the “apt install postgresql-16-pg-gvm” code and after this I just needed to create the DB user and password, and then the gvm could be executed successfully.