title: apt upgrade mysqlserver freezes and will not upgrade (ubuntu server 20.04)
body: <p>I had to kill the session and then the databases are inaccessible until I reboot the server.</p>
  <p>When I log back in and issue ‘apt upgrade’ i get the following error.</p>
  <pre><code>E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
  </code></pre>
  <p>I run ‘dpkg --configure -a’ and get the following and then it just freezes</p>
  <pre><code>Setting up mysql-server-8.0 (8.0.22-0ubuntu0.20.04.3) ...
  mysqld will log errors to /var/log/mysql/error.log
  mysqld is running as pid 86150
  </code></pre>
  <p>On another tty
  journalctl -xe gives this when the upgrade freezes.</p>
  <pre><code>-- The unit mysql.service has successfully entered the 'dead' state.
  Jan 13 22:18:12 arpradio systemd[1]: Stopped MySQL Community Server.
  -- Subject: A stop job for unit mysql.service has finished
  -- Defined-By: systemd
  -- Support: http://www.ubuntu.com/support
  -- 
  -- A stop job for unit mysql.service has finished.
  -- 
  -- The job identifier is 582 and the job result is done.
  Jan 13 22:18:13 arpradio audit[6057]: AVC apparmor=&quot;STATUS&quot; operation=&quot;profile_replace&quot; info=&quot;same as current profile, skipping&quot; profile=&quot;unconfined&quot; name=&quot;/usr/sbin/mysqld&quot; pid&gt;
  Jan 13 22:18:13 arpradio kernel: audit: type=1400 audit(1610572693.036:16): apparmor=&quot;STATUS&quot; operation=&quot;profile_replace&quot; info=&quot;same as current profile, skipping&quot; profile=&quot;uncon&gt;
  </code></pre>
  <p>When I reboot and login mysqld is running</p>
  <p>I have tried the following.</p>
  <pre><code># cp -r /etc/mysql /etc/mysql_old
  # apt autoremove
  E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
  # dpkg --configure -a
  Setting up mysql-server-8.0 (8.0.22-0ubuntu0.20.04.3) ...
  mysqld will log errors to /var/log/mysql/error.log
  mysqld is running as pid 7451
  </code></pre>
  <p>And we are back here with the freeze.</p>
  <p>If I check the mysql processes I find no process 7451 but this is the output.</p>
  <pre><code># ps aux | grep mysql
  root        1679  0.0  0.0   8644  4688 ?        Ssl  22:23   0:00 dockerize -template /tmp/db.cnf.tmpl:/etc/mysql/conf.d/db.cnf /usr/local/bin/docker-entrypoint.sh mysqld
  systemd+    2526  0.3  0.1 2446780 99836 ?       Sl   22:23   0:03 mysqld
  root        7370  0.3  0.0  27940 19836 pts/0    S+   22:38   0:00 /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/mysql-server-8.0.postinst configure 8.0.22-0ubuntu0.20.04.2
  root        7379  0.0  0.0   9756  3772 pts/0    S+   22:38   0:00 /bin/bash /var/lib/dpkg/info/mysql-server-8.0.postinst configure 8.0.22-0ubuntu0.20.04.2
  mysql       7657  1.9  0.5 1869164 358336 pts/0  Sl+  22:39   0:01 mysqld --user=mysql --init-file=/var/lib/mysql-files/tmp.gQukBE7GtT --socket=/tmp/tmp.KUFQmDDseF/mysqld.sock --pid-file=/tmp/tmp.KUFQmDDseF/mysqld.pid
  root        7759  0.0  0.0   9032   724 pts/1    S+   22:39   0:00 grep --color=auto mysql
  </code></pre>
  <p>I checked the status of mysql.service</p>
  <pre><code># systemctl status mysql.service 
  ● mysql.service - MySQL Community Server
       Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
       Active: inactive (dead) since Wed 2021-01-13 22:38:59 CET; 17min ago
      Process: 649 ExecStart=/usr/sbin/mysqld (code=exited, status=0/SUCCESS)
     Main PID: 649 (code=exited, status=0/SUCCESS)
       Status: &quot;Server shutdown complete&quot;
  
  Jan 13 22:21:43 arpradio systemd[1]: Starting MySQL Community Server...
  Jan 13 22:21:45 arpradio systemd[1]: Started MySQL Community Server.
  Jan 13 22:38:57 arpradio systemd[1]: Stopping MySQL Community Server...
  Jan 13 22:38:59 arpradio systemd[1]: mysql.service: Succeeded.
  Jan 13 22:38:59 arpradio systemd[1]: Stopped MySQL Community Server.
  </code></pre>