Updating Webmin to (2.641) gets stuck

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Webmin version 2.641
Usermin version 2.540
Virtualmin version 8.1.0 GPL
Theme version 26.41
Package updates All installed packages are up to date

The same problem with the post-install script getting hung that I had with updating Virtualmin, is now happening when updating to Webmin 2.641

Running Apt upgrade -y installed all the other updates, but when it got to Webmin 2.641 it gets blocked.
Virtualmin and Webmin work fine as I can see, and on the dashboard it shows that Webmin did upgrade to 2.641, but I can no longer do anything else with dpkg as it gives the error that the package is only half configured:

root@issole /home/HappyN # **dpkg --audit**
The following packages are only half configured, probably due to problems
configuring them the first time.  The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 webmin               web-based administration interface for Unix systems

root@issole /home/HappyN # **apt --fix-broken install**
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
root@issole /home/HappyN # **dpkg --configure -a**
Setting up webmin (2.641) ...

canceling the process after half an hour give this:

error processing package webmin (--configure):
 installed webmin package post-installation script subprocess was interrupted

How to reset DPKG to clear this error?

Many thanks!

Usually harmless to run the recheck config from the menu. Non destructive and an off chance of giving a hint.

Did you try the suggestion above?
dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

I did try to manually run ‘sudo dpkg --configure -a’ and that is precisely where it gets stuck every time and has to be aborted to get out of it.

In case this happens to anyone else, the solution I found on the internet was to rename the webmin.postinst file located at /var/lib/dpkg/info/ so that dpkg cannot find it. Then running ‘sudo dpkg --configure -a’ finishes immediately and clears the dpkg blockage.

No idea if that affects Webmin in any way, but it seems to be running normally.