[LINUX] "The following signatures couldn't be verified because the public key is not available" and "404 Not Found" errors at the time of apt-get update

environment

WSL Ubuntu 18.04.

nana@LAPTOP:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"

Details of the error

After a long time apt-get update, I encountered two kinds of errors

nana@LAPTOP:~$ sudo apt-get update
Get:1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease [3626 B]
Hit:2 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic InRelease
Ign:3 http://ppa.launchpad.net/aseering/wsl/ubuntu bionic InRelease
Err:1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:5 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Err:7 http://ppa.launchpad.net/aseering/wsl/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.83 80]
Get:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Reading package lists... Done
W: GPG error: https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease: The following signatures couldn't be verified bec
ause the public key is not available: NO_PUBKEY 51716619E084DAB9
E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ 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.
E: The repository 'http://ppa.launchpad.net/aseering/wsl/ubuntu bionic Release' does not have a Release file.
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.

approach

Part 1

First of all, how to deal with the first error ↓

Err:1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9

This is an error due to the expiration of the public key. Update with the apt-key adv command.

nana@LAPTOP:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
Executing: /tmp/apt-key-gpghome.UfENnbgHmi/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
gpg: key 51716619E084DAB9: public key "Michael Rutter <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1

If you apt-get update again

nana@LAPTOP:~$ sudo apt-get update
Hit:1 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic InRelease
Get:2 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease [3626 B]
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Ign:5 http://ppa.launchpad.net/aseering/wsl/ubuntu bionic InRelease
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Err:7 http://ppa.launchpad.net/aseering/wsl/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.83 80]
Get:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:9 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages [76.8 kB]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/aseering/wsl/ubuntu bionic Release' does not have a Release file.
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.

The public key error is gone.

Part 2

Next, I will manage this error ↓.

Err:7 http://ppa.launchpad.net/aseering/wsl/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.83 80]

Use Silver Searcher to search for files with ppa under / etc / apt /.

nana@LAPTOP:~$ ag ppa /etc/apt/
/etc/apt/sources.list.d/aseering-ubuntu-wsl-bionic.list
1:deb http://ppa.launchpad.net/aseering/wsl/ubuntu bionic main
2:# deb-src http://ppa.launchpad.net/aseering/wsl/ubuntu bionic main

/etc/apt/sources.list.d/ansible-ubuntu-ansible-bionic.list
1:deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main
2:# deb-src http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main

/etc/apt/sources.list.d/aseering-ubuntu-wsl-bionic.list.save
1:deb http://ppa.launchpad.net/aseering/wsl/ubuntu bionic main
2:# deb-src http://ppa.launchpad.net/aseering/wsl/ubuntu bionic main

Comment out all the lines mentioned.

nana@LAPTOP:~$ sudo vi /etc/apt/sources.list.d/ansible-ubuntu-ansible-bionic.list
  1 # deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main
  2 # deb-src http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main

And when I try apt-get update again

nana@LAPTOP:~$ sudo apt-get update
Hit:1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Fetched 252 kB in 7s (34.3 kB/s)
Reading package lists... Done

Now all the errors are gone for the time being.

reference

https://chrisjean.com/fix-apt-get-update-the-following-signatures-couldnt-be-verified-because-the-public-key-is-not-available/ https://hibiki-press.tech/learn_prog/dev-env/apt-update-gpg/1976 https://yuis-programming.com/?p=2048

Recommended Posts

"The following signatures couldn't be verified because the public key is not available" and "404 Not Found" errors at the time of apt-get update
The update of conda is not finished.
At the time of python update on ubuntu
Just fix the sudo apt-get update errors and warnings