# \`UndefVarError: repo not defined\` when add pkg on v1.0

**URL:** <https://discourse.julialang.org/t/undefvarerror-repo-not-defined-when-add-pkg-on-v1-0/15860>\
**Category:** New to Julia\
**Created:** [October 4, 2018, 3:54am UTC](https://discourse.julialang.org/t/undefvarerror-repo-not-defined-when-add-pkg-on-v1-0/15860 "2018-10-04T03:54:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paalon/32/5784_2.png) [@paalon](https://discourse.julialang.org/u/paalon)\
**Post date:** [October 4, 2018, 3:54am UTC](https://discourse.julialang.org/t/undefvarerror-repo-not-defined-when-add-pkg-on-v1-0/15860/1 "2018-10-04T03:54:06Z")

</div>

I downloaded Julia binary and simlinked as `julia-1.0.1`.  
When I try to add packages, the following error:

```julia
fushimi at step in ~
↪ julia-1.0.1
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.0.1 (2018-09-29)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(v1.0) pkg> add Distributions
  Updating registry at `~/.julia/registries/General`
ERROR: UndefVarError: repo not defined
Stacktrace:
 [1] update_registry(::Pkg.Types.Context) at /buildworker/worker/package_linux64/build/usr/share/julia
/stdlib/v1.0/Pkg/src/API.jl:123
 [2] #handle_repos_add!#32(::Bool, ::Nothing, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.Packa
geSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:6
07
 [3] #handle_repos_add! at ./none:0 [inlined]
 [4] #add_or_develop#13(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{()
,Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/
package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:54
 [5] (::getfield(Pkg.API, Symbol("#kw##add_or_develop")))(::NamedTuple{(:mode,),Tuple{Symbol}}, ::type
of(Pkg.API.add_or_develop), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at ./none:0
 [6] do_add!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at /buildworker
/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/REPLMode.jl:709
 [7] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Functio
n, ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:697
 [8] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:696
 [9] do_cmd!(::Pkg.REPLMode.PkgCommand, ::REPL.LineEditREPL) at /buildworker/worker/package_linux64/bu
ild/usr/share/julia/stdlib/v1.0/Pkg/src/REPLMode.jl:603
 [10] #do_cmd#33(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at /buildworker/worker/package_lin
ux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/REPLMode.jl:577
 [11] do_cmd at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/REPLMode
.jl:573 [inlined]
 [12] (::getfield(Pkg.REPLMode, Symbol("##44#47")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.Lin
eEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /buildworker/worker/package_linux64/
build/usr/share/julia/stdlib/v1.0/Pkg/src/REPLMode.jl:912
 [13] #invokelatest#1 at ./essentials.jl:697 [inlined]
 [14] invokelatest at ./essentials.jl:696 [inlined]
 [15] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIS
tate) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/LineEdit.jl:22
61
 [16] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/
build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:1029
 [17] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/juli
a/stdlib/v1.0/REPL/src/REPL.jl:191
 [18] (::getfield(Base, Symbol("##719#721")){Bool,Bool,Bool,Bool})(::Module) at ./logging.jl:311
 [19] #invokelatest#1 at ./essentials.jl:697 [inlined]
 [20] invokelatest at ./essentials.jl:696 [inlined]
 [21] macro expansion at ./logging.jl:308 [inlined]
 [22] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:330
 [23] exec_options(::Base.JLOptions) at ./client.jl:242
 [24] _start() at ./client.jl:421

```

appeared. What does it mean?

---

<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:** [October 4, 2018, 1:46pm UTC](https://discourse.julialang.org/t/undefvarerror-repo-not-defined-when-add-pkg-on-v1-0/15860/2 "2018-10-04T13:46:42Z")

</div>

Looks like a bug, could you open an issue at [https://github.com/JuliaLang/Pkg.jl](https://github.com/JuliaLang/Pkg.jl).

---

<div class="post-metadata">

**Author:** ![paalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paalon/32/5784_2.png) [@paalon](https://discourse.julialang.org/u/paalon)\
**Post date:** [October 9, 2018, 11:11am UTC](https://discourse.julialang.org/t/undefvarerror-repo-not-defined-when-add-pkg-on-v1-0/15860/3 "2018-10-09T11:11:30Z")

</div>

I opened the issue.  
[https://github.com/JuliaLang/Pkg.jl/issues/806](https://github.com/JuliaLang/Pkg.jl/issues/806)

---

<div class="post-metadata">

**Author:** ![Edward\_Montague](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/edward_montague/32/28803_2.png) [@Edward\_Montague](https://discourse.julialang.org/u/Edward_Montague)\
**Post date:** [May 30, 2022, 11:18pm UTC](https://discourse.julialang.org/t/undefvarerror-repo-not-defined-when-add-pkg-on-v1-0/15860/4 "2022-05-30T23:18:52Z")

</div>

I deleted all of the .julia directory and the used REPL with julia to load in  
packages; this reconstructed most of everything in the new .julia directory.

You may need to add packages as you try new code.
