We had an issue with our instance of Jenkins on our Ubuntu server which purged our configs and packages.
Because of that, we are attempting to re-install Jenkins on this server. However, we continue to get an error when running sudo apt-get update
Err:6 https://pkg.jenkins.io/debian-stable binary/ Release
Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 151.101.194.133 443]
We have followed all the steps on the Jenkins Ubuntu install page: https://www.jenkins.io/doc/book/installing/linux/
We have also made sure to remove Jenkins from the apt list and add back all the necessary files (once again by following the steps on the Jenkins page).
The steps we have tried:
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \ /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
<-- This is the issue where we get the error mentioned above.
I have also tried:
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | apt-key add -
We are running java version 8 on Ubuntu 20.04
###EDITE### I have also opened a thread on the Jenkins site, see link below: https://community.jenkins.io/t/certificate-is-not-trusted-when-installing-jenkins/1255/7
They are suggesting that my ca-certs are out of date on this vm and thus are not accepting the letsencrypt root certificates.