Open zero77 opened 6 years ago
Perhaps you could clarify what you mean?
It does this already in some ways, unless the file has been changed in some way
In the .chocolatey directory there seems to be lots of old directory’s, with names and version numbers of packages that I have set chocolatey to check for updates, both the current version and previous versions.
For example: ChocolateyGUI.0.13.2 ChocolateyGUI.0.15.0 chocolatey-core.extension.1.3.3 chocolatey-core.extension.1.3.1 and more.
Possibly, this issue has been described before. I'd like to see a CLI option that does roughly the same as Homebrew for macOS with brew cleanup
, which removes everything, except what is needed for the latest installed version. It removes old installed versions and installers, which may take up a lot of space. I don't know if Chocolatey already does this automatically, but it would be nice to know this.
@erikhuizinga There is choco optimize that does a lot of cleanup and Package Reducer that automatically cleans up packaging. https://chocolatey.org/docs/features-package-reducer
We've also noted #1124 for removing things from the cache.
@zero77 the .chocolatey
directory should be ignored, as it is for choco internals and will move likely into a db format at some point.
Yes, moving it into a DB file would be great. Though, for now it would be good if chocolatey could automatically clear .chocolatey
of old leftover directories.
Because, each time a package is updated a new directory is created within .chocolatey
without the old ones being removed, resulting in a lot of old directories being left behind.
@zero77 the old ones actually have a purpose.
There's also this pending to be approved choco cleaner I wrote :) https://chocolatey.org/packages/choco-cleaner/0.0.1
@zero77 the old ones actually have a purpose.
@ferventcoder I'm going to guess that when you uninstall a package the old C:\ProgramData\chocolatey.chocolatey\packagename files are used to remove additional files and registry keys that might be left over from older versions of the program but not in the current one?
@ferventcoder ok I understand, its necessary until a DB has been developed.
@bcurran3 Thanks, I will have a look, though is it on github.
@zero77, yes. Can be found via the package source link on the Chocolatey page or directly here: https://github.com/bcurran3/ChocolateyPackages/tree/master/choco-cleaner
the old ones actually have a purpose.
Is it possible for you to expound upon that purpose?
It seems to me that the files serve no purpose once a package has been removed.
Here's an example off my machine. The files don't take up that much space, less than 7 MB, but my natural curiosity wants to know how the files related to old versions of packages and no longer installed packages are useful?
Directory of C:\ProgramData\chocolatey.chocolatey - 1170 Dir(s)
01/30/2018 03:48 AM
Can you please get chocolatey to automatically remove old files from C:\ProgramData\chocolatey.chocolatey after a package has been updated. Thanks