If you upgraded Ubuntu to version 22.04, then you will need to install DBD::MariaDB from cpan.
The libdbd-mariadb-perl package is not building for Ubuntu 22.04. This is a bug that I was hoping would be fixed by now. See https://bugs.launchpad.net/ubuntu/+source/libdbd-mariadb-perl/+bug/1969911.
There are instructions on how to install from cpan in the WeBWorK 2.18 installation instructions. See https://webwork.maa.org/wiki/Installation_Manual_for_2.18_on_Ubuntu#Install_and_Testing_MariaDB.
The libdbd-mariadb-perl package is not building for Ubuntu 22.04. This is a bug that I was hoping would be fixed by now. See https://bugs.launchpad.net/ubuntu/+source/libdbd-mariadb-perl/+bug/1969911.
There are instructions on how to install from cpan in the WeBWorK 2.18 installation instructions. See https://webwork.maa.org/wiki/Installation_Manual_for_2.18_on_Ubuntu#Install_and_Testing_MariaDB.