Solution 1:

~ EDIT ~

Judging by the following lines from your posted output:

mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured

I am pretty sure you just need to run

sudo apt install mysql-server-8.0

as I said (say?) below, there are 2 nearly identically named packages, so I can see it being an easy oversight. Not sure why it didn't just grab the dependencies to begin with, but regardless, the command above should fix.

~ Tl;dr: ~

I have listed 2 fixes in the bottom section below. You can go ahead and try the first, as it is likely what you need, but wait until I have seen the output I have requested before moving to the second.


There are 2 different Apt packages, both in the same repository (focal proposed), for mysql 8.0. One is named and versioned as follows:

mysql-server/focal-proposed,focal-proposed 8.0.26-0ubuntu0.20.04.3 all

and the other:

mysql-server-8.0/focal-proposed 8.0.26-0ubuntu0.20.04.3 amd64

do you have both?

Run the dpkg-query command below for both, just to be sure.


Fix at the bottom.


NOTE:

The next section describes how to determine the issue for sure, but the fix, written at the bottom of this post, will be the same in any case. It is up to you whether or not you want to follow through or skip ahead.


~ PINPOINTING THE CAUSE ~

From what it says, you need them both. The second one is architecture dependent, and the other is for any Ubuntu Desktop system.

The next step for you depends on the result you get from running the following command:

dpkg-query -l mysql-server-8.0

The character codes in the output represent the status, along with other info.

If it shows as not installed, it is because you have a different version of mysql. Also, notice how the version number is part of the package name for the offending version? That is because in this package, MySQL 8.0 is NOT an update from the older versions. Therefore, you cannot just update it with apt upgrade. Whoever maintains MySQL decided to release it as a completely separate package, so updating to this from the older mysql-server-xxx package would be like upgrading from postgres to MySQL... Impossible.

If it is showing somewhere between not installed and installed it is a 1-command fix, but we really need to know how far along it got in the installation process to know the most efficient fix. The command above should provide this.

Although the second method below should fix regardless, there are better ways. That was put last for a reason. It is the catch-all method for if better methods do not prove fruitful. Also, if the first command in the solution section is not run first, the last one may give an error.

~ ANSWER ~

First, you can try configuring / reconfiguring. You have 2 packages on your system that need this hopefully at least 1 is a mysql-server package. The command to configure all packages that need it is:

dpkg --configure --pending

If configuring does not work, the best way to work around this issue is to remove your old package and then install mysql-server and mysql-server-8.0 fresh. This should keep your configuration files and all other writes (i.e. your databases) intact, as long as you do not use the --purge option! Using this will remove it all!

If you have to do this, google first to find someone else who has already done so. It is up to the pkg developer to list dependencies, and the wrong mistake in that configuration can lead to big problems. It is rare, but still worth the 1-2 minutes it takes to google the phrase apt remove mysql.

The command to remove and reinstall is:

sudo apt remove mysql-server-8.0 && sudo apt install 

Solution 2:

I'm more curious about this error message:

Renaming removed key_buffer and myisam-recover options (if present)
ERROR: Unable to start MySQL server:
mysqld: Can't read dir of '/etc/mysql/conf.d/' (OS errno 13 - Permission denied)
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.

Once the problem is resolved, run apt-get --fix-broken install to retry.
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
  1. Let go first fix the half installed package:

    sudo mv /var/lib/dpkg/info/mysql-server-8.0.postinst /var/lib/dpkg/info/mysql-server-8.0.postinst.backup
    sudo apt -f install
    sudo mv /var/lib/dpkg/info/mysql-server-8.0.postinst.backup /var/lib/dpkg/info/mysql-server-8.0.postinst
    
  2. Check again if mysql server reboots fine:

    sudo service mysql restart