# How to deinstall a package

**URL:** <https://discourse.julialang.org/t/how-to-deinstall-a-package/9854>\
**Category:** General Usage\
**Created:** [March 21, 2018, 11:01am UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854 "2018-03-21T11:01:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [March 21, 2018, 11:01am UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/1 "2018-03-21T11:01:30Z")

</div>

Thsi question is relevant to the current package manager. It there is an answer for Pkg3 this will be welcome also. The Documentation does have a section on removing packages. but it is unclear and has not worked for me in the past. Should I use Pkg.free(“packagename”) ??

I have three use cases at the momen tfor removing packages:

- I might give a talk to colleagues. I might want to demonstrate how to install IJulia
- I wish to develop in the ClusterManagers package - so need to remove the existing copy and substitute with the development version
- sometimes I am convinced that a package is completely fuled up and I want to start from a clean install

I do admit that the third use case is stupid, but I have got into messes in the past with ImageView on Windows 10 and I ended up wiping Julia and starting from scratch.

---

<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:** [March 21, 2018, 11:04am UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/2 "2018-03-21T11:04:32Z")

</div>

`Pkg.rm` is the way on Pkg2.

It is similarly used in Pkg3 except it won’t actually delete the package, it will just remove it from the project. In Pkg3 you can have multiple versions of the same package installed at the same time and different projects can use different versions.

If you want to show julia from scratch with Pkg2 you can set the `JULIA_PKGDIR` env variable to some folder and do `Pkg.init()`.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [March 21, 2018, 3:18pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/3 "2018-03-21T15:18:20Z")

</div>

Also, in `Pkg3` you can use the `pkg> gc` command to delete all package versions that are no longer referred to by any projects (those found in `~/.julia/logs/manifest_usage.toml`). For example, I just did this on my system:

```julia
pkg> gc
[ Info: Deleted 93 package installations saving 395.409 MiB

```

I suspect most people won’t have quite so many random package versions installed since I do a fair bit of messing around with installing and changing packages. The `pkg> gc` command isn’t yet called automatically, but we intend to set that up at some point in the future. It will also clean up old resources like obsolete `.ji` files.

---

<div class="post-metadata">

**Author:** ![jwu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jwu/32/3775_2.png) [@jwu](https://discourse.julialang.org/u/jwu)\
**Post date:** [November 20, 2018, 4:23pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/4 "2018-11-20T16:23:03Z")

</div>

`rm package` only removed the package in `packages` folder. It can not remove package in the `dev` folder. How can I do it?

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 20, 2018, 4:27pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/5 "2018-11-20T16:27:31Z")

</div>

```julia
rm -rf ~/dev/PackageName

```

---

<div class="post-metadata">

**Author:** ![adamslc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamslc/32/3452_2.png) [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Post date:** [November 20, 2018, 4:30pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/6 "2018-11-20T16:30:58Z")

</div>

I think you mean

```julia
rm -rf ~/.julia/dev/PackageName

```

Your version would be quite catastrophic if someone had a `dev` folder in their home directory!

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 20, 2018, 4:32pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/7 "2018-11-20T16:32:49Z")

</div>

That’s where I keep my dev packages. Don’t run random code some guy posts on the Internet without making sure it doesn’t do something bad 😬

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [November 20, 2018, 5:12pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/8 "2018-11-20T17:12:33Z")

</div>

you can have a (default) dev path that is different (not under) the `JULIA_DEPOT_PATH`?  
Or you just manually do `dev /path/to/my/dev` for every package you dev?

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 20, 2018, 5:15pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/9 "2018-11-20T17:15:46Z")

</div>

Both are possible: [Pkg · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Pkg/#Developing-packages-1)

---

<div class="post-metadata">

**Author:** ![jwu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jwu/32/3775_2.png) [@jwu](https://discourse.julialang.org/u/jwu)\
**Post date:** [November 20, 2018, 7:58pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/10 "2018-11-20T19:58:51Z")

</div>

after removing the package, I get some errors:

```julia
ERROR: path /usr/people/jingpeng/.julia/dev/Clustering for package Clustering no longer exists. Remove
 the package or `develop` it at a new path                                                            

```

I have to run  
pkg \> `rm package` to really remove it in Project.toml file.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 20, 2018, 8:20pm UTC](https://discourse.julialang.org/t/how-to-deinstall-a-package/9854/11 "2018-11-20T20:20:13Z")

</div>

Correct. I assumed you’d already done that since a package wouldn’t be gc’d unless it was removed from all projects already.
