# It takes several minutes to add a single package

**URL:** https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704
**Category:** New to Julia
**Tags:** pkg, environment
**Created:** [October 31, 2021, 8:59pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704 "2021-10-31T20:59:07Z")
**Posts on this page:** 20
**Page:** 4

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [November 2, 2021, 2:36pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/61 "2021-11-02T14:36:31Z")

</div>

> [@giordano](#):
>
> You’re happy with that?

Indeed, that is a problem. More reason then to be transparent to the user, and have he/she have complete control over the updates. If the user tries `up`s something and it does not get the latest version, we should tell him that, and that is it (the package manager does that, but only if the user wants to install a specific version). - or at least give the user that option, with a simple flag, like `add -q`, `up -q`.

I know when I’m using my linux distribution that many packages are being hold back because I do not have the latest distro. But I have the choice to when/how update things, without that messing up with my daily use of the system.

(and, as pointed by @Lilith, we have a situation where even adding a dummy package may trigger a lot of work, without having anything to do with any compat bounds).

> [@dlakelan](#):
>
> Doing the `] reg rm General` then `]reg add General` should dramatically speed things in 1.7 it won’t use git at all. This only affects your account not other users of the cluster.

I have a friend that had that kind of issue and 1.7 improved things a lot. It does not seem to be the same issue I have in that cluster.

---

<div class="post-metadata">

### Author: ![Lilith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lilith/32/27492_2.png) [@Lilith](https://discourse.julialang.org/u/Lilith)
#### Post date: [November 2, 2021, 2:46pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/62 "2021-11-02T14:46:07Z")

</div>

Yet another candidate solution:

1. Make `]add` more conservative about updating unnecessary packages by default
2. Add `]activate --reproducible name` which prevents `name` from stacking with `global` (i.e. has the impact of removing `@v#.#` from `Base.LOAD_PATH` in only in `name`)
3. Stop discouraging global environment usage

Where does it fall short of solving everyone’s problems? Where does it fall short of the status quo?

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [November 2, 2021, 2:58pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/63 "2021-11-02T14:58:18Z")

</div>

> [@dlakelan](#):
>
> Does your cluster use glusterfs for storage? Also did you try Julia 1.7? A lot of work was put into speeding up package management on windows by not crawling directories. This also helps enormously for glusterfs and maybe also for other NFS based filesystems. I think you need to install 1.7 and rm the existing registry then add it back.

This was discussed in messages 44, 47, and some others.

> [@lmiq](#):
>
> I am getting this error message, and it does not seem to be working (or is it?). In any case, it is taking a lot of time anyway:
> 
> ![image](https://global.discourse-cdn.com/julialang/original/3X/8/2/82a495e4f052e23027d7f0f2b0d2fee7c479016f.png)

It’s not working and falling back to getting the registry with git, i.e. exactly what it was doing before. Do you have some firewall or similar interfering? (I’m not an expert on SSL and certs stuff, hopefully someone else can help out with understanding that error.)

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [November 2, 2021, 3:55pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/64 "2021-11-02T15:55:02Z")

</div>

> [@GunnarFarneback](#):
>
> Do you have some firewall or similar interfering?

Not that I am aware of or have any control over. I will try to reach to the maintainers to see. If anyone has any hint on how to get more information, that would be nice, I would be able to provide them more data to track the issue.

One curiosity: is the new registry system ported to 1.6?

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [November 2, 2021, 3:56pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/65 "2021-11-02T15:56:03Z")

</div>

> [@lmiq](#):
>
> One curiosity: is the new registry system ported to 1.6?

No. It’s a new feature, namely, the ability for Pkg to use a registry tarball without needing to extract the tarball.

As a general rule, new features are not backported.

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [November 2, 2021, 4:47pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/66 "2021-11-02T16:47:49Z")

</div>

> [@Lilith](#):
>
> Add `]activate --reproducible name` which prevents `name` from stacking with `global` (i.e. has the impact of removing `@v#.#` from `Base.LOAD_PATH` in only in `name` )

Ooh I really like that.

@lmiq try setting a different package server

```julia
JULIA_PKG_SERVER=us-west.pkg.julialang.org

```

or some other one.

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [November 2, 2021, 4:53pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/67 "2021-11-02T16:53:34Z")

</div>

it is the same:

```julia
(@v1.7) pkg> registry add General
┌ Warning: could not download https://us-west.pkg.julialang.org/registries
│ exception = Cert verify failed: BADCERT_EXPIRED while requesting https://us-west.pkg.julialang.org/registries
└ @ Pkg.Registry /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Pkg/src/Registry/Registry.jl:82
     Cloning registry from "https://github.com/JuliaRegistries/General.git"

```

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [November 2, 2021, 8:09pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/68 "2021-11-02T20:09:10Z")

</div>

Is the system time on your cluster badly miscalibrated?

Perhaps it thinks now is past the expiration date of the cert?

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [November 2, 2021, 8:27pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/69 "2021-11-02T20:27:38Z")

</div>

> [@dlakelan](#):
>
> Perhaps it thinks now is past the expiration date of the cert?

It is one hour in advance that it should be (now it is 17:27 here, and `date` reports 18:27). Can that be a problem? (reported already to the admin)

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [November 2, 2021, 8:30pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/70 "2021-11-02T20:30:03Z")

</div>

well, it seems like 1 hr shouldn’t be enough. When I connect to [https://us-west.pkg.julialang.org](https://us-west.pkg.julialang.org) I see

Expires on: January 17, 2022

Is it possible you misread the output of date and it’s actually off by a year or something?

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [November 2, 2021, 8:30pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/71 "2021-11-02T20:30:59Z")

</div>

> [@dlakelan](#):
>
> off by a year or something?

nope:  
% date  
Tue Nov 2 18:26:26 BRST 2021

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [November 2, 2021, 8:32pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/72 "2021-11-02T20:32:45Z")

</div>

I’m not sure exactly, but I wonder if there isn’t a key exchange that occurs which is time-sensitive (like a symmetric key is negotiated and the far server says it’s good for 10 minutes) which then on the local end appears to be expired immediately. Get the time fixed, and see if it works! it’s definitely suspicious that the time is off!

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [November 2, 2021, 8:40pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/73 "2021-11-02T20:40:20Z")

</div>

Downloading github repositories seem to be particularly problematic. Any idea?

The tarball of julia downloaded now at 7Mb/s, but one repository downloaded at 280Kb/s (the same goes for the tarball of the release of that same repository).

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [November 2, 2021, 9:05pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/74 "2021-11-02T21:05:28Z")

</div>

It’s kinda unheard of to have a high performance cluster that has 7Mbps connection to the internet. So maybe talk with the administrators and see if they’ve got a serious networking issue. Like maybe there’s a network broadcast storm they don’t even know about? That’s definitely odd.

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [November 2, 2021, 9:10pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/75 "2021-11-02T21:10:06Z")

</div>

> [@dlakelan](#):
>
> have a high performance cluster that has 7Mbps connection to the internet.

I wish. That is actually good… We don’t get much better speeds on anything involving the university link.

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [November 2, 2021, 9:11pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/76 "2021-11-02T21:11:28Z")

</div>

Hunh… I’ve got a gigabit to my house… so I guess YMMV 😝

---

<div class="post-metadata">

### Author: ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)
#### Post date: [November 2, 2021, 9:30pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/77 "2021-11-02T21:30:54Z")

</div>

This is where it would help if Pkg always told you if a more recent version was available but it wasn’t installing because reasons.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [November 2, 2021, 9:35pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/78 "2021-11-02T21:35:57Z")

</div>

> [@kristoffer.carlsson](#):
>
> The updated versions caused a lot of packages having to recompile in the big environment.

I have to say that I find it frustrating that Julia _defaults_ to updating the registry, and potentially updates _all_ of my packages (if new versions are available, which is often the case) whenever I want to install a single new package. I really only want it to update if I specifically run `pkg> update` — otherwise, Julia should assume I’m happy with the versions I currently have.

A workaround that does what I want is to put

```julia
Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true

```

in your `~/.julia/config/startup.jl`, but I wish this was the default.

---

<div class="post-metadata">

### Author: ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)
#### Post date: [November 2, 2021, 11:21pm UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/79 "2021-11-02T23:21:56Z")

</div>

One thing that might improve the user experience is to expand the documentation on environments, focusing on how to use them effectively, and not on how they are implemented. Currently, neither Julia’s nor Pkg’s manuals include the terms `local environment` or `temporary environment`. `activate` has only a short reference section in Pkg’s documentation.

---

<div class="post-metadata">

### Author: ![Lilith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lilith/32/27492_2.png) [@Lilith](https://discourse.julialang.org/u/Lilith)
#### Post date: [November 3, 2021, 12:20am UTC](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704/80 "2021-11-03T00:20:50Z")

</div>

I disagree. I think the best solution is making manual environment management less necessary rather than giving more instructions on how to do it.

[Previous page](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704.md?page=3)

[Next page](https://discourse.julialang.org/t/it-takes-several-minutes-to-add-a-single-package/70704.md?page=5)
