# Pkg.update() taking ~10min, how do I debug?

**URL:** <https://discourse.julialang.org/t/pkg-update-taking-10min-how-do-i-debug/53926>\
**Category:** General Usage\
**Created:** [January 25, 2021, 8:18pm UTC](https://discourse.julialang.org/t/pkg-update-taking-10min-how-do-i-debug/53926 "2021-01-25T20:18:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [January 25, 2021, 8:18pm UTC](https://discourse.julialang.org/t/pkg-update-taking-10min-how-do-i-debug/53926/1 "2021-01-25T20:18:08Z")

</div>

On this one particular system, `Pkg.update()`s are unbearably slow, it spends 5-10 minutes displaying `Updating registry at ~/.julia/registries/General`. This system has a notorioulsy slow network filesystem, granted not this slow. Or maybe its something related to the network connection? (although d/l speeds are not this slow either, and this is nominally a well connected campus cluster in the US). Any suggestions for how to figure out whats going on? I’ve tried with Julia 1.5.3 / 1.6-beta1.

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [January 25, 2021, 8:31pm UTC](https://discourse.julialang.org/t/pkg-update-taking-10min-how-do-i-debug/53926/2 "2021-01-25T20:31:43Z")

</div>

What happens if you disable (or switch) the Pkg server via `ENV["JULIA_PKG_SERVER"]=""`? I’ve found that it loves to connect to the notoriously flaky `us-east(2).pkg.julialang.org` regardless of which side of NA my machine is on…

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [January 25, 2021, 8:51pm UTC](https://discourse.julialang.org/t/pkg-update-taking-10min-how-do-i-debug/53926/3 "2021-01-25T20:51:49Z")

</div>

On my machine (MacOS), I observe high cpu usage by antivirus (sophos) during `Pkg.update`.  
I excluded `.julia` from virus scanning, but it made no difference.  
Other threads mentioned that the registry gets unpacked to a local dir before updates are applied. I would exlude that local dir, but don’t know how to locate it.

---

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [January 25, 2021, 9:01pm UTC](https://discourse.julialang.org/t/pkg-update-taking-10min-how-do-i-debug/53926/4 "2021-01-25T21:01:26Z")

</div>

Thanks, I tried that and it seemed to work better, although I’m unsure if there’s something being cached anyway, since after an initial ~10min `update()`, if I try again right away even without `ENV["JULIA_PKG_SERVER"]=""` its fairly fast. Will keep an eye on it.

---

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [January 25, 2021, 9:19pm UTC](https://discourse.julialang.org/t/pkg-update-taking-10min-how-do-i-debug/53926/5 "2021-01-25T21:19:04Z")

</div>

> [@hendri54](#):
>
> Other threads mentioned that the registry gets unpacked to a local dir before updates are applied. I would exlude that local dir, but don’t know how to locate it.

That’s interesting and could maybe be at play. Does anyone know how to control this directory? Maybe I can put it on a local filesystem instead of the network one.
