This installation of MySQL is already upgraded to 5.7.25?
Actually here is a solution that worked for me:
https://techierg.blogspot.com/2019/06/ubuntu-1804-mysql-this-installation-of.html
Quote:

Briefly, the solution is
Edit the file /var/lib/dpkg/info/mysql-server-5.7.postinst

sudo nano /var/lib/dpkg/info/mysql-server-5.7.postinst

At line # 370, comment out the echo ALTER statement which would like

#echo &quot;ALTER USER 'root'@'localhost' IDENTIFIED WITH 'auth_socket';&quot;                 &gt;&gt; &quot;$initfile&quot; 
Restart the VM, then...

Run dpkg configure again and the problem will be solved.

sudo dpkg --configure -a
That solved it for me and saved me hours of research.
The article refers to this link here:
https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1817374/comments/8