Thank you for taking the time to file a bug report. I could reproduce the bug here by following these steps (which are listed in your DpkgTerminalLog.txt file):
$ lxc launch images:ubuntu/focal mysql-bug1934383 $ lxc shell mysql-bug1934383 # apt update # apt install mysql-server -y # apt remove --purge -y mysql-server # apt autoremove # apt purge -y mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-* # rm -rf /etc/mysql/ # apt-get install mysql-server The interesting part from the log is this: update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist This error indicates that there is no /etc/mysql/mysql.cnf file, which is strange and shouldn't happen after you install the MySQL package. So, there are two things at play here: the removal of a directory by hand, and not purging the right package. I am assuming that you removed the /etc/mysql/ directory by hand (like I did in the reproduction steps above). However, your apt commands did not purge the package that owned the directory, which is mysql- server-8.0. In fact, you can check this by: # dpkg -S /etc/mysql/ mysql-server-8.0: /etc/mysql As a general rule, we should never manually remove something from the system that was installed by a package. In this specific case, the proper way to get rid of the directory is to purge the package that owns it: # apt purge mysql-server-8.0 Since it seems likely to me that this is a local configuration problem, rather than a bug in Ubuntu, I am marking this bug as 'Incomplete'. However, if you believe that this is really a bug in Ubuntu, then we would be grateful if you would provide a more complete description of the problem with steps to reproduce, explain why you believe this is a bug in Ubuntu rather than a problem specific to your system, and then change the bug status back to "New". For local configuration issues, you can find assistance here: http://www.ubuntu.com/support/community ** Changed in: mysql-8.0 (Ubuntu) Status: New => Incomplete -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1934383 Title: package mysql-server-8.0 (not installed) failed to install/upgrade: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 2 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1934383/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs