因为有墙的原因,在安排julia库时,往往从镜像站点拉取安装速度更为。
也就是手动设置JULIA_PKG_SERVER。 比如从
export JULIA_PKG_SERVER="https://pkg.julialang.org"
切换到:
JULIA_PKG_SERVER = https://mirrors.bfsu.edu.cn/julia/static
或:
JULIA_PKG_SERVER = https://mirrors.sjtug.sjtu.edu.cn/julia
等等
那这个库就可以比较智能地看哪个地址速度不错。
julia> using PkgServerClient
julia> versioninfo()
Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Environment:
JULIA_PKG_SERVER = https://mirrors.ustc.edu.cn/julia
julia> PkgServerClient.generate_startup("JuliaLang")
┌ Info: New PkgServer
│ Server = "https://pkg.julialang.org"
└ ConfigFile = "C:\\Users\\songroom\\.julia\\config\\startup.jl"
julia> PkgServerClient.registry
Dict{String, NamedTuple{(:org, :url), Tuple{String, String}}} with 9 entries:
"BFSU" => (org = "北京外国语大学开源软件镜像站", url = "https://mirrors.bfsu.edu.cn/julia")
"OpenTUNA" => (org = "OpenTUNA开源镜像站 -- TUNA 协会", url = "https://opentuna.cn/julia")
"ISCAS" => (org = "中国科学院软件研究所", url = "https://mirror.iscas.ac.cn/julia")
"SJTUG" => (org = "上海交通大学Linux用户组 (SJTUG) 软件源镜像服务", url = "https://mirrors.sjtug.sjtu.edu.cn/julia")
"SUSTech" => (org = "南方科技大学开源镜像站", url = "http://mirrors.sustech.edu.cn/julia")
"TUNA" => (org = "清华大学开源软件镜像站 -- TUNA 协会", url = "https://mirrors.tuna.tsinghua.edu.cn/julia")
"USTC" => (org = "中国科学技术大学开源软件镜像", url = "https://mirrors.ustc.edu.cn/julia")
"JuliaLang" => (org = "The official Julia pkg server", url = "https://pkg.julialang.org")
"NJU" => (org = "南京大学开源镜像站", url = "https://mirrors.nju.edu.cn/julia")
|