I had this issue too. Every time I started apt get and installed the process would hang after or during the DB update. None of the other solutions here worked.
In the end I purged
sudo apt purge mysql-server mysql-server-5.7
And followed the manual install from the instructions for mysql here
I then overwrote the data directory with my old data
sudo cp -Rfv /var/lib/mysql /usr/local/mysql/data
and finally added a systemd service like this
/lib/systemd/system/mysql.service
[Unit]
Description=MySQL Server
After=syslog.target
After=network.target
[Service]
Type=simple
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/run/mysqld
ExecStartPre=/bin/chown mysql:mysql -R /var/run/mysqld
ExecStart=/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/lib/mysql/plugin --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
TimeoutSec=300
PrivateTmp=true
User=mysql
Group=mysql
WorkingDirectory=/usr
[Install]
WantedBy=multi-user.target
Then ran
# systemctl daemon-reload
# systemctl enable mysql
# systemctl start mysql
Then everything seemed to be working as before and mysql was not breaking system updates
The downside, of course, is that I'll need to do manual updates in the future.