getting error installing rabbitmq on ubuntu 22.04

$ sudo apt install rabbitmq-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 165 not upgraded.
Need to get 0 B/15.7 MB of archives.
After this operation, 24.3 MB of additional disk space will be used.
Selecting previously unselected package rabbitmq-server.
(Reading database ... 109565 files and directories currently installed.)
Preparing to unpack .../rabbitmq-server_3.12.4-1_all.deb ...
Unpacking rabbitmq-server (3.12.4-1) ...
Setting up rabbitmq-server (3.12.4-1) ...
Job for rabbitmq-server.service failed because the control process exited with error code.
See "systemctl status rabbitmq-server.service" and "journalctl -xeu rabbitmq-server.service" for details.
invoke-rc.d: initscript rabbitmq-server, action "restart" failed.
● rabbitmq-server.service - RabbitMQ broker
     Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2023-09-16 15:22:45 EDT; 10ms ago
    Process: 2443805 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=1/FAILURE)
   Main PID: 2443805 (code=exited, status=1/FAILURE)
     Status: "Standing by"
        CPU: 5.709s
dpkg: error processing package rabbitmq-server (--configure):
 installed rabbitmq-server package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any idea how to fix?

Read more here: Source link