Introduction
If the cPanel internal Perl isn't working and errors are seen and /scripts/check_cpanel_pkgs is unable to run then you may be able to reinstall the RPMs forcibly looping through those RPMs using the RPM database.
Procedure
First determine the OS installed with
cat /etc/redhat-release
Example output:
CentOS Linux release 7.9.2009 (Core)
Then get the existing cpanel-perl RPMs version needed from the RPM database. Just one line is needed.
rpm -qa |grep cpanel-perl| tail -1
example output:
cpanel-perl-532-crypt-dsa-1.17-1.cp1198.noarch
Now we can set up the URL to obtain the RPMs to be reinstalled from http://httpupdate.cpanel.net/RPM/ and using the example out the path brings us to http://httpupdate.cpanel.net/RPM/11.98/centos/7/x86_64/
Next we can create a while loop to read the cpanel-perl RPMs installed and force reinstall them with:
rpm -qa |grep cpanel-perl-532 | while read x; do rpm -ivh --nodeps --force http://httpupdate.cpanel.net/RPM/11.98/centos/7/x86_64/$x.rpm ; done
Please note: The above one liner is an example and will need to be adjusted based upon the cPanel version and operating system version.