I tried to install a package with yarn earlier today and I got this
yarn install yarn install v1.9.4 [1/4]
If you are using WSL for linux just add the current ip domain in: C:\Windows\System32\drivers\etc\hosts e.g:
104.16.21.35 registry.yarnpkg.com