# Pkg.add doesn't work

**URL:** <https://discourse.julialang.org/t/pkg-add-doesnt-work/38299>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [April 27, 2020, 12:43pm UTC](https://discourse.julialang.org/t/pkg-add-doesnt-work/38299 "2020-04-27T12:43:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EmmyJ](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@EmmyJ](https://discourse.julialang.org/u/EmmyJ)\
**Post date:** [April 27, 2020, 12:43pm UTC](https://discourse.julialang.org/t/pkg-add-doesnt-work/38299/1 "2020-04-27T12:43:18Z")

</div>

Hi,  
I’ve just done a fresh install of Julia (tried multiple versions already, but I need v0.6) and whenever I try Pkg.add, I get the same error:  
I’m on a Windows 10.

> julia\> Pkg.add(“IJulia”)  
> INFO: Initializing package repository C:\Users\EmJacobs.julia\v0.6  
> INFO: Cloning METADATA from [GitHub - JuliaLang/METADATA.jl: Metadata for registered Julia packages up to Julia v0.6. No longer maintained. Please see https://github.com/JuliaRegistries/General instead.](https://github.com/JuliaLang/METADATA.jl)  
> ERROR: GitError(Code:ERROR, Class:OS, Failed to rename lockfile to ‘C:/Users/EmJacobs/.julia/v0.6/jl\_1E99.tmp/METADATA/.git/objects/pack/pack-d1674f5e7842e87b42948fd78c43b3a79f6ba6a3.idx’: Access is denied.  
> )  
> Stacktrace:  
> [1] macro expansion at .\libgit2\error.jl:99 [inlined]  
> [2] clone(::String, ::String, ::Base.LibGit2.CloneOptions) at .\libgit2\repository.jl:276  
> [3] #clone#100(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::String, ::String) at .\libgit2\libgit2.jl:562  
> [4] (::Base.LibGit2.#kw##clone)(::Array{Any,1}, ::Base.LibGit2.#clone, ::String, ::String) at .\<missing\>:0  
> [5] (::Base.Pkg.Dir.##8#10{String,String})() at .\pkg\dir.jl:55  
> [6] cd(::Base.Pkg.Dir.##8#10{String,String}, ::String) at .\file.jl:59  
> [7] init(::String, ::String) at .\pkg\dir.jl:53  
> [8] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at .\pkg\dir.jl:28  
> [9] add(::String) at .\pkg\pkg.jl:117

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [April 27, 2020, 12:47pm UTC](https://discourse.julialang.org/t/pkg-add-doesnt-work/38299/2 "2020-04-27T12:47:00Z")

</div>

This seems to be a windows problem. I am not sure how permissions work on windows, have you tried executing Julia as administrator just to see if it works? On the other hand, if you did this already, and now is executing as a normal user, this may be the source of the problem, if the old files can now only be touched by an administrator.

---

<div class="post-metadata">

**Author:** ![EmmyJ](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@EmmyJ](https://discourse.julialang.org/u/EmmyJ)\
**Post date:** [April 27, 2020, 12:52pm UTC](https://discourse.julialang.org/t/pkg-add-doesnt-work/38299/3 "2020-04-27T12:52:14Z")

</div>

Hi,  
Yes I’ve tried running Julia as administrator, same error…

Also, I’ve now found a version where this does work: 1.1.1, so it isn’t windows related it seems…  
Too bad I need version 0.6.4

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [April 27, 2020, 4:56pm UTC](https://discourse.julialang.org/t/pkg-add-doesnt-work/38299/4 "2020-04-27T16:56:19Z")

</div>

> [@EmmyJ](#):
>
> Too bad I need version 0.6.4

Just out of curiosity, why do you need 0.6.4? This version is almost two years old, is unsupported, and you’ll be stuck with ancient, unsupported packages. (For a data point, LightGraphs 0.12 was the last version to work with 0.6; we’re currently prepping a 2.0 version. There’s no way we’d be able to support LG 0.12 for anyone.)

Is there a specific package that you need that only runs on pre-1.0 versions of Julia?

---

<div class="post-metadata">

**Author:** ![alejandromerchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alejandromerchan/32/10500_2.png) [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)\
**Post date:** [April 28, 2020, 11:18pm UTC](https://discourse.julialang.org/t/pkg-add-doesnt-work/38299/5 "2020-04-28T23:18:07Z")

</div>

How are you installing Julia? I had an issue like that in the past (not on Windows, though) for not using the official binaries. I don’t know if that’s another possible explanation.

---

<div class="post-metadata">

**Author:** ![EmmyJ](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@EmmyJ](https://discourse.julialang.org/u/EmmyJ)\
**Post date:** [April 29, 2020, 9:34am UTC](https://discourse.julialang.org/t/pkg-add-doesnt-work/38299/6 "2020-04-29T09:34:26Z")

</div>

> [@alejandromerchan](#):
>
> that in the past (not on Windows, though) for not using the official binaries. I don’t know if that’s another possible explanation.

I’m using the .exe installer from the [julialang.org](http://julialang.org) downloads page.
