Suppose I updated from Julia v1.8 to Julia v1.9. How to delete all the cache from v1.8? Can I just delete .julia/environments/v1.8? Is this the recommended method?
That directory doesn't exist. The only version-specific directory is depot/compiled/vX.Y
, it's unclear whether you meant that or something else
I fixed the typo, I meant .julia/environments/v1.8
Is it enough to clean these environment directories? Is there a Pkg command to cleanup anything related to a version x.y?
Juliaup has a command to uninstall a version, but I don't know if it actually deletes all the files
You can always just copy the project / manifest files and your config folder and then nuke everything else and re-instantiate
Given your question was "delete all the cache" you might have been after ~/.julia/compiled/v1.8
rather than the environment? ~/.julia/environments/v1.8
should just be a Project and Manifest file, so even with a big environment that's going to be <100kB, not worth worrying about?
What about the artifacts? Is there a way to selectively delete them for the packages that are no longer needed?
Nils said:
Given your question was "delete all the cache" you might have been after
~/.julia/compiled/v1.8
rather than the environment?~/.julia/environments/v1.8
should just be a Project and Manifest file, so even with a big environment that's going to be <100kB, not worth worrying about?
Thanks for clarifying it @Nils , you are probably right. I am just wondering if there is a general established mechanism to clean up anything related to a global environment.
Leandro Martínez said:
What about the artifacts? Is there a way to selectively delete them for the packages that are no longer needed?
Pkg.gc
is automatically run periodically, which should take care of those artifacts. You can also manually run ]gc --all
to do it right away.
Júlio Hoffimann said:
Thanks for clarifying it Nils , you are probably right. I am just wondering if there is a general established mechanism to clean up anything related to a global environment.
I don't think there is. Also note that my suggestion about compiled
is not specific to the global environment, but will delete all compiled code from any environment you had in 1.8, i.e. if you re-run some code in 1.8 you will have to precompile again (probably not an issue, but just wanted to clarify).
Last updated: Dec 28 2024 at 04:38 UTC