hyper-v to setup centos-9-stream dnf update throws ssl error

48 Views Asked by At

Setup the centos-9-stream.iso in the hyper-v, was able to login.

When issuing dnf update or dnf install java-17-openjdk-headless seeing below message

$ dnf install java-17-openjdk-headless
CentOS Stream 9 - BaseOS                                                                                                                                                                                   0.0  B/s |   0  B     00:43
Errors during downloading metadata for repository 'baseos':
  - Curl error (60): SSL peer certificate or SSH remote key was not OK for https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http [SSL certificate problem: unable to get local issuer certificate]
Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: Curl error (60): SSL peer certificate or SSH remote key was not OK for https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http [SSL certificate problem: unable to get local issuer certificate]

Is there any option to resolve this issue

1

There are 1 best solutions below

0
Tim On

At least for my requirement, updated the /etc/dnf/dnf.conf file with below

sslverify=False

Now dnf update works without any issue. also in order to connect to the internet had updated the /etc/resolv.conf file nameserver 8.8.8.8.