# Pkg fetching takes very long at 99.9% @ v1.6 (Win 10)

**URL:** <https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499>\
**Category:** General Usage\
**Created:** [March 4, 2021, 8:21pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499 "2021-03-04T20:21:41Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [March 4, 2021, 8:21pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/1 "2021-03-04T20:21:41Z")

</div>

Should this be reported as a bug or is it to be expected with RC?

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/f/df831b988b9ad1a99e5ed562f499d7ab64362a23.png)

---

<div class="post-metadata">

**Author:** ![helgee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/helgee/32/2022_2.png) [@helgee](https://discourse.julialang.org/u/helgee)\
**Post date:** [March 8, 2021, 7:52am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/2 "2021-03-08T07:52:47Z")

</div>

It seems that you are still using the old (slow) Git-based registry download. Try this maybe?

> [@Pkg.update in Julia 1.5 uses github](https://discourse.julialang.org/t/pkg-update-in-julia-1-5-uses-github/44331/2):
>
> You probably have the General registry as a git repo. Delete it and install it again.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [March 8, 2021, 8:27am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/3 "2021-03-08T08:27:09Z")

</div>

Unfortunately, I have to confirm that it sometimes takes forever to download the registry on Windows. I’ve observed this even on a fresh machine with no previous local (git) registry and also when setting `ENV["JULIA_PKG_SERVER] = ""` and so on. Internet connection was fine and can’t explain the behaviour. This really spoils the Julia experience right from the start.

~~Oddly, I believe to have observed (not sure) that the title of the Julia REPL window (i.e. powershell window) sometimes say something like “Select user” or similar. Randomly hitting “Enter” has in some cases continued/sped up the download. But maybe I’m hallucinating… Would be great if someone could investigate this systematically.~~ (Too speculative)

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [March 8, 2021, 9:08am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/4 "2021-03-08T09:08:10Z")

</div>

Just to contribute more substantial evidence to the discussion:

![julia_slow](https://global.discourse-cdn.com/julialang/original/3X/8/4/847ffea9c89cffe8715b8beea1a45cf84ded6517.gif)

I tried to make the gif match “real time”. It hangs at 99,9% for about 2 minutes. This is Julia 1.6 on windows 10 with no prior Julia installation (i.e. no `~/.julia` directory).

(BTW, I don’t think it is 1.6 specific. I also saw this effect on 1.5 already.)

---

<div class="post-metadata">

**Author:** ![helgee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/helgee/32/2022_2.png) [@helgee](https://discourse.julialang.org/u/helgee)\
**Post date:** [March 8, 2021, 9:53am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/5 "2021-03-08T09:53:46Z")

</div>

I nuked my registries (on 1.5 and 1.6) and tried again. Same results here. The initial installation takes ages.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 8, 2021, 10:37am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/6 "2021-03-08T10:37:37Z")

</div>

Check if Windows Defender is taking a lot of CPU.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [March 8, 2021, 11:08am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/7 "2021-03-08T11:08:56Z")

</div>

![julia_faster](https://global.discourse-cdn.com/julialang/original/3X/9/6/96a702091449d762d5354b55f7decc14b54557f5.gif)

Indeed, turning off Windows Defender reduces the time quite noticably to about 30 seconds. I would still say that it could be faster (it is on macOS) but it is probably acceptable like this. So I guess the question is how to avoid the chiming in of Windows Defender.

(BTW, Windows Defender is not using terribly much CPU. For me it was around 30 %)

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [March 8, 2021, 11:45am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/8 "2021-03-08T11:45:59Z")

</div>

I have `~/.julia/` added as an exception in Windows Defender.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 8, 2021, 1:02pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/9 "2021-03-08T13:02:15Z")

</div>

What will probably happen is that files will be read straight out of the tar ball downloaded (see [Tar.extract\_file: extract content of single file in tarball by fredrikekre · Pull Request #95 · JuliaIO/Tar.jl · GitHub](https://github.com/JuliaIO/Tar.jl/pull/95)) which would avoid having to materialize so many files (which is what causes Windows Defender to be unhappy). Might take a while for that though.

---

<div class="post-metadata">

**Author:** ![sdewaele](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sdewaele](https://discourse.julialang.org/u/sdewaele)\
**Post date:** [May 16, 2021, 2:37pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/10 "2021-05-16T14:37:02Z")

</div>

Thanks for the suggestion! Just to verify - is this the same as “Add an exclusion to Windows Security” described [here](https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26)?

---

<div class="post-metadata">

**Author:** ![deszoeke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/deszoeke/32/2174_2.png) [@deszoeke](https://discourse.julialang.org/u/deszoeke)\
**Post date:** [February 18, 2022, 11:04pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/11 "2022-02-18T23:04:20Z")

</div>

I have the same problem with Julia 1.7.2 on linux. It eventually works after spending about 2 min at Fetching…99.9%

---

<div class="post-metadata">

**Author:** ![suavesito](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/suavesito/32/34386_2.png) [@suavesito](https://discourse.julialang.org/u/suavesito)\
**Post date:** [February 19, 2022, 1:14am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/12 "2022-02-19T01:14:43Z")

</div>

That’s… weird. Can you elaborate more into if you were running a lot of other processes?, or maybe a big IO operation? HDD vs SSD?

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [February 19, 2022, 2:31am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/13 "2022-02-19T02:31:12Z")

</div>

Try deleting your registries and re-adding them, which will switch to using a tarball instead of a git clone.

---

<div class="post-metadata">

**Author:** ![deszoeke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/deszoeke/32/2174_2.png) [@deszoeke](https://discourse.julialang.org/u/deszoeke)\
**Post date:** [February 21, 2022, 4:01am UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/14 "2022-02-21T04:01:39Z")

</div>

Yes, thanks. Deleting the registries as in

> [@Pkg.update in Julia 1.5 uses github](https://discourse.julialang.org/t/pkg-update-in-julia-1-5-uses-github/44331/2):
>
> You probably have the General registry as a git repo. Delete it and install it again.

speeds it up so the time is nearly unnoticeable.

I would not have expected this slow git registry download to affect a new install of Julia 1.7.2.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [February 21, 2022, 1:45pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/15 "2022-02-21T13:45:01Z")

</div>

That only happens if you have a git cloned registry, which either means you manually created a git cloned registry at some point, in which case we figure you know what you’re doing, or that you have been using that registry since many Julia versions ago without deleting your registries, which is possible but seems somewhat unlikely.

---

<div class="post-metadata">

**Author:** ![avik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avik/32/17_2.png) [@avik](https://discourse.julialang.org/u/avik)\
**Post date:** [February 21, 2022, 3:02pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/16 "2022-02-21T15:02:39Z")

</div>

This is quite an old thread, but since people are talking about windows defender, it’s probably worthwhile to mention here that Pkg downloads and extracts the registry tar bundle in a temporary directory. This means that excluding `.julia` from Windows Defender is not sufficient. The tar bundle contains tens of thousands of small files, and that is what causes Windows Defender to lock up for minutes.

Newer versions of Julia operate by not extracting the files in the tar bundle, which should be helpful.

---

<div class="post-metadata">

**Author:** ![jdad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jdad/32/4739_2.png) [@jdad](https://discourse.julialang.org/u/jdad)\
**Post date:** [February 21, 2022, 4:24pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/17 "2022-02-21T16:24:59Z")

</div>

Only for Julia \>= 1.7, cf.

- Registries downloaded from the Pkg Server (not git) are no longer uncompressed into files but instead read directly from the compressed tarball into memory. This improves performance on filesystems which do not handle a large number of files well. To turn this feature off, set the environment variable `JULIA_PKG_UNPACK_REGISTRY=true` .

In [https://github.com/JuliaLang/julia/blob/v1.7.0/NEWS.md](https://github.com/JuliaLang/julia/blob/v1.7.0/NEWS.md)

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [January 20, 2023, 8:55pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499/18 "2023-01-20T20:55:39Z")

</div>

3 posts were split to a new topic: [Pkg update stuck at 100%](https://discourse.julialang.org/t/pkg-update-stuck-at-100/93283)
