11
November
2025
Problem with MySQL Server 8.0 repository signing after 10/22/2025
17:02

Problem with MySQL Server 8.0 repository signing after 10/22/2025

11 November 2025 17:02

The problem is with the key 0xB7B3B788A8D3785C because it is outdated. The article provides a solution to the problem.

At the end of October 2025, there was a problem with the signature of the repository repo.mysql.com, and the command sudo apt update displays an error:

W: An error occurred while verifying the signature. The repository is not updated and the previous index files will be used. GPG Error: http://repo.mysql.com/apt/ubuntu jammy InRelease: The following signatures are invalid: EXPKEYSIG B7B3B788A8D3785C MySQL Release Engineering mysql-build@oss.oracle.com
W: Failed to get http://repo.mysql.com/apt/ubuntu/dists/jammy/InRelease The following signatures are invalid: EXPKEYSIG B7B3B788A8D3785C MySQL Release Engineering mysql-build@oss.oracle.com
W: Some index files could not be downloaded. They were ignored or older versions were used instead.

Reason: The key has expired.New key released from 10/23/2025 to 10/23/2027.
Key UID: MySQL Release Engineering mysql-build@oss.oracle.com

Solution

1) Delete the old, expired key with an expiration date of October 22, 2025.

If the key was added in the old way to the shared key store

sudo apt-key del B7B3 B788 A8D3 785C

If the key was added to a separate gpg file (new way):

cd /etc/apt/trusted.gpg.d
ls *.gpg
sudo rm mysql8.gpg

2) Using GPG, download the new key B7B3B788A8D3785C

cd ~
gpg --keyserver keyserver.ubuntu.com --recv B7B3B788A8D3785C

Screen output:
gpg: key B7B3B788A8D3785C: "MySQL Release Engineering mysql-build@oss.oracle.com" 2 new signatures
gpg: Total processed: 1
gpg: new signatures: 2

Let's import the gpg key in a new way:

gpg --export B7B3B788A8D3785C | sudo tee /etc/apt/trusted.gpg.d/mysql.gpg > /dev/null

Points 3 and 4 can be skipped if the MySQL installation has not changed. These points are provided for reference on what to do if the composition of the mysql server installation has changed.Go to point 5.

3) Generate a default file for mysql

sudo dpkg-reconfigure mysql-apt-config
  • MySQL and Cluster (Currently selected: mysql-8.0)
  • MySQL Tools & Connectors (Currently selected:Enabled)
  • MySQL Preview Packages (Currently selected:Disabled).

    mysql-config1

In the mysql configurator window, press TAB to go to the lower OK button.

mysql-config1a
Press Enter.

On the next screen: "Which server version do you wish to receive?"

Select the current version:

  • mysql 8.0

    mysql-config2

And press TAB to go to the bottom OK button.
mysql-config2

We returned to the previous screen... Use the cursor to move to the small line “ok”.
mysql-config1

To the question:

"The file '/usr/share/keyrings/mysql-apt-config.gpg' exists. Overwrite? (y/N)"

  • answer "Y" and key Enter.
    mysql-config5

4) Edit the file for the application source - a third-party repository:mysql.list

cd /etc/apt/sources.list.d/

sudo nano /etc/apt/sources.list.d/mysql.list

In the editor, you can press Ctrl+\ to replace:

  • Search (what to change) [signed-by=/usr/share/keyrings/mysql-apt-config.gpg]
  • replace with [signed-by=/etc/apt/trusted.gpg.d/mysql.gpg]

Replace this entry?

A - все.

Contents of the file /usr/share/keyrings/mysql-apt-config.gpg after replacement:

mysql-config6

Save the file under the same name: Ctrl+O, Enter, Ctrl+X.


5) Refresh package cache and install updates:

sudo apt update
sudo apt upgrade

!!!Comment. I do not recommend interrupting the apt upgrade update by pressing Ctrl+C, otherwise unsatisfied dependencies will arise.

Solution:sudo apt --fix-broken install

Result

There is no apt update error anymore, the mysql repository is signed with a valid signature B7B3B788A8D3785C.

 gpg --list-keys

Key...785C expiration date: 2027-10-23


Sources:
bugs.mysql.com,
Problem with MySQL 8.0 repository signing after 12/14/2023.



Related publications