# Free an unregistered package?

**URL:** <https://discourse.julialang.org/t/free-an-unregistered-package/26062>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [July 6, 2019, 12:41am UTC](https://discourse.julialang.org/t/free-an-unregistered-package/26062 "2019-07-06T00:41:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuckermcclure](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tuckermcclure/32/1187_2.png) [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Post date:** [July 6, 2019, 12:41am UTC](https://discourse.julialang.org/t/free-an-unregistered-package/26062/1 "2019-07-06T00:41:44Z")

</div>

When I `dev` a local, unregistered package (a Git repo), I don’t see a way to `free` it.

Here’s what I tried:

```julia
]add C:\\Users\\Tucker\\Desktop\\julia-tests\\ANewPackage\\

]dev ANewPackage
ERROR: The following package names could not be resolved:
 * ANewPackage (4f451f22-9f79-11e9-0804-effd68d8229a in manifest but not in project)
Please specify by known `name=uuid`.

]dev C:\\Users\\Tucker\\Desktop\\julia-tests\\ANewPackage\\
 Resolving package versions...
  Updating `C:\Users\Tucker\Desktop\julia-tests\ANotherPackage\Project.toml`
  [4f451f22] ~ ANewPackage v0.1.0 #master (C:\\Users\\Tucker\\Desktop\\julia-tests\\ANewPackage\\) ⇒ v0.1.0 [`C:\\Users\\Tucker\\Desktop\\julia-tests\\ANewPackage\\`]
  Updating `C:\Users\Tucker\Desktop\julia-tests\ANotherPackage\Manifest.toml`
  [4f451f22] ~ ANewPackage v0.1.0 #master (C:\\Users\\Tucker\\Desktop\\julia-tests\\ANewPackage\\) ⇒ v0.1.0 [`C:\\Users\\Tucker\\Desktop\\julia-tests\\ANewPackage\\`]

] free "C:\\Users\\Tucker\\Desktop\\julia-tests\\ANewPackage\\"
ERROR: `C:\\Users\\Tucker\\Desktop\\julia-tests\\ANewPackage\\` cannot be parsed as a package

]free ANewPackage
ERROR: cannot free an unpinned package that does not exist in a registry

```

I can remove the package and add it again, but that’s clumsy. It seems like perhaps once the package is `dev`ed, it only knows about the local path to the files, and hence it doesn’t know how to treat it like a repo any longer? Am I doing anything wrong here, or is there a better way?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [July 6, 2019, 1:03am UTC](https://discourse.julialang.org/t/free-an-unregistered-package/26062/2 "2019-07-06T01:03:13Z")

</div>

There are no version to free it to, you have to add it (by url) again. Note that you don’t have to remove it first though.

---

<div class="post-metadata">

**Author:** ![tuckermcclure](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tuckermcclure/32/1187_2.png) [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Post date:** [July 6, 2019, 1:11am UTC](https://discourse.julialang.org/t/free-an-unregistered-package/26062/3 "2019-07-06T01:11:05Z")

</div>

Thanks! That makes sense, and knowing that I don’t have to remove it is helpful.

---

<div class="post-metadata">

**Author:** ![benninkrs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/benninkrs/32/3191_2.png) [@benninkrs](https://discourse.julialang.org/u/benninkrs)\
**Post date:** [June 20, 2020, 4:25pm UTC](https://discourse.julialang.org/t/free-an-unregistered-package/26062/4 "2020-06-20T16:25:13Z")

</div>

Sorry to resurrect an old thread, but I ran into the same problem and after reading the accepted solution, I still don’t understand why I can’t free an unregistered package. How can it be that “There are no version to free it to”? The version number is specified in the package’s `Project.toml`.

---

<div class="post-metadata">

**Author:** ![benninkrs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/benninkrs/32/3191_2.png) [@benninkrs](https://discourse.julialang.org/u/benninkrs)\
**Post date:** [June 20, 2020, 4:48pm UTC](https://discourse.julialang.org/t/free-an-unregistered-package/26062/5 "2020-06-20T16:48:09Z")

</div>

I think I see what is happening, at least for remote unregistered packages.

When I add an unregistered package via its url, the url is placed in Julia’s `Manifest.toml`. When I `dev` that package, the url is replaced by the local path to the `dev`ed version. Thus, `Manifest.toml` no longer indicates where to find the source repo of the unregistered package. Since `free` doesn’t know where to find the official version of the package, it gives up.

It seems like this could be easily fixed either by retaining the `repo-url` key in the Manifest, or by allowing `free` to accept a url.

---

<div class="post-metadata">

**Author:** ![Emmanuel-R8](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/emmanuel-r8/32/11839_2.png) [@Emmanuel-R8](https://discourse.julialang.org/u/Emmanuel-R8)\
**Post date:** [July 9, 2021, 12:57pm UTC](https://discourse.julialang.org/t/free-an-unregistered-package/26062/6 "2021-07-09T12:57:23Z")

</div>

I had the same problem recently. I went in julia’s environments directory (normally `~/.julia/environments/`, looked for the relevant environment, and edited its `Project.toml` to delete the unregistered package.

Solved the problem.
