简体   繁体   中英

Installing OpenVAS on Kali / Debian problem with PostgreSQL version

After installing OpenVAS on Kali linux, ran gvm-setup command to setup GVM as per instructions: https://linuxhint.com/install-openvas-kali-linux/

However, the following error ocurred:

ERROR: The default postgresql version is not 13 required by libgvmd
Error: Use pg_upgradecluster to update your postgres cluster

So, I checked the version of PostgreSQL installed by:

$ su postgres
$ psql --version
psql (PostgreSQL) 13.2 (Debian 13.2-1)

The version was 13. How can I complete the gvm-setup ?

gvm-setup will look for PostgreSQL on port 5432 . If you have more than one version of PostgreSQL installed, they will be assigned incremental port numbers starting at 5432. To check for other versions of PostgreSQL, you can look in the /etc/postgresql/ directory. You may see multiple directories, corresponding to the PostgreSQL versions you have installed.

You should go into each version and edit the postgresql.conf file to change the port number of PostgreSQL 13 to 5432, and assign other port numbers to the other versions. So if you had PostgreSQL 12 and 13 installed:

Edit the PostgreSQL 12 config file

$ nano /etc/postgresql/12/main/postgresql.conf

find the line port = 5432 and change to:

port = 5433

Edit the PostgreSQL 13 config file

$ nano /etc/postgresql/13/main/postgresql.conf

find the line port = 5433 and change to:

port = 5432

Finally restart PostgreSQL:

systemctl restart postgres

and then run gvm-setup again

gvm-setup

The error message tells you, that you should upgrade your postgres cluster. There could already be a higher version of postgres cluster created in your system, which you can examine with the following command:

sudo pg_lsclusters

However, this auto generated cluster might not always function as intended (eg it operates on different from default port). Thus, it's best to perform manual cluster upgrade (you can omit step 1 if you don't have any auto generated cluster). Assuming that you want to upgrade from version 13 to 14:

  1. delete automatically generated cluster version 14 (use --stop if service status is not down ):

     sudo pg_dropcluster --stop 14 main
  2. migrate cluster version 13 to version 14:

     sudo pg_upgradecluster 13 main
  3. optionally, you can drop the old cluster:

     sudo pg_dropcluster --stop 13 main

That's it, The new cluster will listen on the port. that were previously used by the old cluster. It might be needed to start or enable postgres service in systemd in order to use PostgreSQL in other applications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM