When installing the jenkins am getting some certifciate error

ERROR: The certificate of ‘pkg.jenkins.io’ is not trusted.

The certificate has expired
The certificate’s owner does not match hostname ‘pkg.jenkins.io

Make sure you download the new key:
Linux (jenkins.io)