/var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory
This is a common problem after MySQL upgrade.
The issue is, the symlink /usr/share/mysql-common/configure-symlinks doesn't exist.
Just create the symlink and run apt upgrade
or apt-get upgrade
and it will work
We can do the following to fix the issue
touch $$
: this creates a file with a unique name.
touch /tmp/$$.$$ ; cd /usr/share/mysql-common/ ; ln -s /tmp/$$.$$ /usr/share/mysql-common/configure-symlinks ; chmod 777 /usr/share/mysql-common/configure-symlinks ; apt -y upgrade ; rm -f /tmp/$$.$$
note - the issue has appeared in older versions as well and the usual fix is to remove and install mysql. but the method here is better
This post has received a 2.99 % upvote, thanks to: @bobinson.