[SOLVED] Package Management: Remove a local registry

Question:

I would like to know the command syntax to remove a local registry.

Minimal Working Example:

(APCSv0.1) pkg> registry st
Registry Status 
 [098e1cba] APCS-Registry (git@path.to.registry/apcs-registry.git)
 [23338594] General (https://github.com/JuliaRegistries/General.git)

(APCSv0.1) pkg> registry rm APCS-Registry
ERROR: `APCS-Registry` cannot be parsed as a registry

Comment:

I can update APCS-Registry; if I do up it updates all my packages in both the General registry and my local registry. So the Julia package manager knows about it. The correct command to remove it is registry rm registry-name isn’t it? I have also tried giving it the full git reference, the full path and directory name to the .julia/registries/ folder. I have a feeling if I just delete the folder it won’t completely work and, if that is the intended workflow, what is registry rm registry-name for?

Thx!

3 Likes

I think it works if you put quotes around the name.

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.2 (2021-07-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.6) pkg> registry rm APCS-Registry
ERROR: `APCS-Registry` cannot be parsed as a registry

(@v1.6) pkg> registry rm "APCS-Registry"
ERROR: `APCS-Registry` cannot be parsed as a registry

(@v1.6) pkg> registry rm 'APCS-Registry'
ERROR: `APCS-Registry` cannot be parsed as a registry

(@v1.6) pkg> registry rm "/home/rogerp/.julia/registries/APCS-Registry"
ERROR: `/home/rogerp/.julia/registries/APCS-Registry` cannot be parsed as a registry

(@v1.6) pkg> registry rm '/home/rogerp/.julia/registries/APCS-Registry'
ERROR: `/home/rogerp/.julia/registries/APCS-Registry` cannot be parsed as a registry

(@v1.6) pkg> registry rm `/home/rogerp/.julia/registries/APCS-Registry`
ERROR: ``/home/rogerp/.julia/registries/APCS-Registry`` cannot be parsed as a registry

(@v1.6) pkg> registry st
Registry Status 
 [098e1cba] APCS-Registry (git@git.ccfe.ac.uk:apcs/apcs-registry.git)
 [23338594] General (https://github.com/JuliaRegistries/General.git)

I guess I was wrong,

Pkg.Registry.rm("APCS-Registry")

should work. But the REPL probably need to change the rule for what it determines is a valid registry name.

4 Likes

@kristoffer.carlsson Many thanks. I am sure you’re right. I will check later today when I get a chance.

Perfect.

julia> Pkg.Registry.rm("APCS-Registry")
    Removing registry `APCS-Registry` from ~/.julia/registries/APCS-Registry