Ubuntu Focal Error NO_PUBKEY B7B3B788A8D3785C When Apt Update for MySQL

I was getting this error on Ubuntu 20.04 LTS with MySQL version 8.0.35.

Err:1 http://repo.mysql.com/apt/ubuntu focal InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C

After some research, I tried several suggestions that I found at the links below, but they did not resolve the issue.

https://askubuntu.com/questions/1497140/how-to-fix-apt-update-after-to-upgrade-the-mysql-list-file

https://www.reddit.com/r/mysql/comments/18jj4hm/terminal_update_error/

https://askubuntu.com/questions/1389928/mysql-an-error-occurred-during-the-signature-verification

https://github.com/apache/airflow/issues/20911

However, finally came across this link which did have a solution:
https://askubuntu.com/questions/1498081/no-pubkey-and-some-of-the-file-has-an-unsupported-filetype

Below are the steps to quickly fix it:

  1. Download an updated .deb file from the official mysql site:
    https://dev.mysql.com/downloads/repo/apt/
  2. Install the deb (e.g., mysql-apt-config_0.8.29-1_all.deb):
    sudo dpkg -i <filename>
  3. Then run apt-get update again and the error should not appear.

 

This entry was posted in Uncategorized. Bookmark the permalink.