Julia: remove a package and all its dependencies?

27,593

Solution 1

From the documentation:

Pkg.rm("MarketData")

rm(pkg)

Remove all requirement entries for pkg from Pkg.dir("REQUIRE") and call Pkg.resolve().

This also removes dependencies:

INFO: Removing BufferedStreams v0.4.0
INFO: Removing Codecs v0.4.0
...

Solution 2

Step 1: Press ] to go to package manager .
Step 2: Type rm MarketData

Tested on v1.6

Share:
27,593
miguelmorin
Author by

miguelmorin

Updated on December 05, 2021

Comments

  • miguelmorin
    miguelmorin over 2 years

    After adding a package, e.g. MarketData, with:

    Pkg.add("MarketData")
    

    which also installs dependencies:

    INFO: Installing BufferedStreams v0.4.0
    INFO: Installing Codecs v0.4.0
    ...
    

    how can I remove or uninstall the package and all its dependencies?

  • Colin T Bowers
    Colin T Bowers about 5 years
    Users may also want to run pkg> gc to clean up removed packages from the packages directory. Also note, this step does not remove content from the dev or compiled folder. They must be deleted manually (after free has been run).
  • KugelBlitz
    KugelBlitz over 2 years
    Hi, unfortunately trying rm is giving me an error The following package names could not be resolved: * MyPackage (not found in project or Manifest) Even free doesn't work. gives me same error
  • miguelmorin
    miguelmorin over 2 years
    @KugelBlitz Sorry, I stopped using Julia a few years ago. You may have better luck asking a new question.
  • KugelBlitz
    KugelBlitz over 2 years
    That's fine, I just deleted the whole folder and ran it again which resolved my issue, turned out it was no big deal!