# Error in Pkg.update()

**URL:** <https://discourse.julialang.org/t/error-in-pkg-update/81837>\
**Category:** General Usage\
**Created:** [May 28, 2022, 2:19pm UTC](https://discourse.julialang.org/t/error-in-pkg-update/81837 "2022-05-28T14:19:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raymond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raymond/32/36557_2.png) [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Post date:** [May 28, 2022, 2:19pm UTC](https://discourse.julialang.org/t/error-in-pkg-update/81837/1 "2022-05-28T14:19:26Z")

</div>

What’s wrong with this problem?

```julia
julia> using Pkg

julia> Pkg.update()
    Updating registry at `~/.julia/registries/General.toml`
┌ Warning: could not download https://pkg.julialang.org/registries
│ exception = Connection timed out after 30003 milliseconds while requesting https://pkg.julialang.org/registries
└ @ Pkg.Registry /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/Pkg/src/Registry/Registry.jl:82

```

---

<div class="post-metadata">

**Author:** ![Raymond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raymond/32/36557_2.png) [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Post date:** [May 28, 2022, 2:54pm UTC](https://discourse.julialang.org/t/error-in-pkg-update/81837/2 "2022-05-28T14:54:19Z")

</div>

The problem is solved. It is the problem of network.

---

<div class="post-metadata">

**Author:** ![JohnnyChen94](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnnychen94/32/29979_2.png) [@JohnnyChen94](https://discourse.julialang.org/u/JohnnyChen94)\
**Post date:** [May 28, 2022, 4:47pm UTC](https://discourse.julialang.org/t/error-in-pkg-update/81837/3 "2022-05-28T16:47:15Z")

</div>

If you’re in mainland China, you can target to the mirror servers

For instance, downloading from BFSU server would be blazingly fast by setting the environment variable:

```julia
julia> ENV["JULIA_PKG_SERVER"] = "https://mirrors.bfsu.edu.cn/julia"

```

More information can be found in [Julia PkgServer 镜像服务及镜像站索引 - 库的安装及使用 - Julia中文社区](https://discourse.juliacn.com/t/topic/2969)

---

<div class="post-metadata">

**Author:** ![Raymond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raymond/32/36557_2.png) [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Post date:** [May 29, 2022, 8:18pm UTC](https://discourse.julialang.org/t/error-in-pkg-update/81837/4 "2022-05-29T20:18:31Z")

</div>

> [@JohnnyChen94](#):
>
> ` ENV["JULIA_PKG_SERVER"] = "https://mirrors.bfsu.edu.cn/julia"`

Thanks very much. It works wery well.
