server – Problems installing VirtualBox 7.1.2 for Linux (Ubuntu 22.04)

I’m experiencing problems installing VirtualBox 7.1.2 for Linux.
After downloading the latest version for Ubuntu 22.04 from Virtual Box website
and using dpkg -i virtualbox-7.1_7.1.2-164945~Ubuntu~jammy_amd64.deb command the terminal showed this error.

tomas@tomas-efficast:~/Downloads$ sudo dpkg -i virtualbox-7.1_7.1.2- 
164945~Ubuntu~jammy_amd64.deb
Selecting previously unselected package virtualbox-7.1.
(Reading database ... 224150 files or directories currently installed.)
Preparing to unpack virtualbox-7.1_7.1.2-164945~Ubuntu~jammy_amd64.deb ...
Unpacking virtualbox-7.1 (7.1.2-164945~Ubuntu~jammy) ...
dpkg: dependency problems prevent configuration of virtualbox-7.1:
virtualbox-7.1 depends on libxcb-cursor0 (>= 0.0.99); however:
The package `libxcb-cursor0' is not installed.

dpkg: error processing package virtualbox-7.1 (--install):
dependency problems - leaving configured
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (2.1-2) ...
Errors were encountered while processing:
virtualbox-7.1

I tried using sudo apt-get purge "^virtualbox-.*" then sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean for cleaning the packages but I received the same error.

I would appreciate any suggestions or possible solutions.

Read more here: Source link