Seems I have resolved it by simply exporting this environment variable:
export JULIA_PKG_SERVER=pkg.julialang.org