I have been trying to download MySQL 5.7 on a Ubuntu 20.04 server. I specifically need MySQL 5.7 and cannot use a newer version. The public key for http://repo.mysql.com/apt/ubuntu in the bionic release has expired. How can I force Ubuntu to download it anyway?
So first, I did
wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
, which worked fine.
Then I ran sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb
and selected ubuntu bionic and then MySQL 5.7.
I then ran sudo apt-get update
to download from the newly added repository. However, when I ran it, this was the output,
Get:1 http://repo.mysql.com/apt/ubuntu bionic InRelease [20.0 kB]
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://mirrors.digitalocean.com/ubuntu focal InRelease
Hit:4 http://mirrors.digitalocean.com/ubuntu focal-updates InRelease
Hit:5 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease
Err:1 http://repo.mysql.com/apt/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
Hit:6 http://mirrors.digitalocean.com/ubuntu focal-backports InRelease
Reading package lists... Done
W: GPG error: http://repo.mysql.com/apt/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
E: The repository 'http://repo.mysql.com/apt/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely and is, therefore, disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I would like to specifically focus on this section of the output:
Err:1 http://repo.mysql.com/apt/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
While at first I assumed there was something wrong with the publix key, after opening /etc/apt/sources.list, I found this:
--------------------
pub dsa1024 2003-02-03 [SCA] [expired: 2022-02-16]
A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5
uid [ expired] MySQL Release Engineering <[email protected]>
/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-archive.gpg
------------------------------------------------------
Since the public key has expired for this repository, I need to force ubuntu to download it without a key. How do I do this? I looked online but didn't really understand much. Sorry if this is a lame question, but I have spent hours on this and caved in on asking. Thanks a whole lot to whoever knows the answer.
Also, just for reference, I was using steps similar to these guides: Install MySQL 5.7 on Ubuntu 20.04
However, since the key has expired, they did not work :(.