# Error by adding registry

**URL:** <https://discourse.julialang.org/t/error-by-adding-registry/63428>\
**Category:** General Usage\
**Tags:** question, registry\
**Created:** [June 23, 2021, 9:06am UTC](https://discourse.julialang.org/t/error-by-adding-registry/63428 "2021-06-23T09:06:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Impressium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/impressium/32/19575_2.png) [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Post date:** [June 23, 2021, 9:06am UTC](https://discourse.julialang.org/t/error-by-adding-registry/63428/1 "2021-06-23T09:06:57Z")

</div>

Hi all,

I don’t understand that error and don’t know how to prevent it. I want to add a local registry with LocalRegistry.jl. Does anyone know what it means?

```julia
julia> path = LocalRegistry.create_registry(
           "Trinity", # name_or_path
           "Trinity" # repo
       )
warning: LF will be replaced by CRLF in Registry.toml.
The file will have its original line endings in your working directory
[ Info: Created registry in directory C:\Users\<user>\.julia\registries\Trinity
"C:\\Users\\<user>\\.julia\\registries\\Trinity"

julia> spec = Pkg.RegistrySpec(path=path)
Pkg.Registry.RegistrySpec(nothing, nothing, nothing, "C:\\Users\\<user>\\.julia\\registries\\Trinity", nothing)

julia> Pkg.Registry.add(spec)
     Copying registry from `C:\Users\<user>\.julia\registries\Trinity`
ERROR: ArgumentError: 'src' and 'dst' refer to the same file/dir.This is not supported.
  `src` refers to: C:\Users\<user>\.julia\registries\Trinity
  `dst` refers to: C:\Users\<user>\.julia\registries\Trinity

Stacktrace:
  [1] checkfor_mv_cp_cptree(src::String, dst::String, txt::String; force::Bool)
    @ Base.Filesystem .\file.jl:318
  [2] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
    @ Base.Filesystem .\file.jl:364
  [3] (::Pkg.Registry.var"#38#40"{Base.TTY, String, Pkg.Registry.RegistrySpec, Nothing})(tmp::String)
    @ Pkg.Registry C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Registry\Registry.jl:220
  [4] mktempdir(fn::Pkg.Registry.var"#38#40"{Base.TTY, String, Pkg.Registry.RegistrySpec, Nothing}, parent::String; prefix::String)
    @ Base.Filesystem .\file.jl:750
  [5] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem .\file.jl:748
  [6] download_registries(io::Base.TTY, regs::Vector{Pkg.Registry.RegistrySpec}, depot::String)
    @ Pkg.Registry C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Registry\Registry.jl:194
  [7] download_registries
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Registry\Registry.jl:166 [inlined]
  [8] add(regs::Vector{Pkg.Registry.RegistrySpec}; io::Base.TTY)
    @ Pkg.Registry C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Registry\Registry.jl:47
  [9] add(regs::Vector{Pkg.Registry.RegistrySpec})
    @ Pkg.Registry C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Registry\Registry.jl:44
 [10] #add#23
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Registry\Registry.jl:41 [inlined]
 [11] add(reg::Pkg.Registry.RegistrySpec)
    @ Pkg.Registry C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Registry\Registry.jl:41
 [12] top-level scope
    @ REPL[7]:1

```

Thanks

---

<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:** [June 23, 2021, 10:03am UTC](https://discourse.julialang.org/t/error-by-adding-registry/63428/2 "2021-06-23T10:03:10Z")

</div>

When you have created the registry in that way it is generated directly in `.julia\registries` and is thus effectively already added (that’s documented here). When you do `julia> Pkg.Registry.add(spec)` you are telling Julia to copy the already installed registry from where it is to the same place, which triggers an error.
