Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache clean command to remove temporary files #1124

Open
alexchandel opened this issue Jan 3, 2017 · 21 comments
Open

cache clean command to remove temporary files #1124

alexchandel opened this issue Jan 3, 2017 · 21 comments

Comments

@alexchandel
Copy link

alexchandel commented Jan 3, 2017

chocolately creates lots of temporary/cached files when installing packages, and these aren't removed when the installation is complete. Even older version aren't removed. Chocolately needs a cleanup command that tells it to delete all its temporary and cached files.

Editor's note: The original issue was filed at chocolatey-archive/chocolatey#253

@ferventcoder
Copy link
Member

Duplicate

@ferventcoder
Copy link
Member

ferventcoder commented Jan 3, 2017

So I thought this was a dupe - we've discussed this and have been planning for awhile. I'm surprised there is not an actual issue filed already.

Edit: chocolatey-archive/chocolatey#253 (linking this to that and closing that issue).

@ferventcoder
Copy link
Member

Older versions are not removed

Please elaborate

@ferventcoder
Copy link
Member

The lot of temp files are cleaned up - change your cacheLocation config value. Then temp is more deterministic and things are cleaned up better

@alexchandel
Copy link
Author

Please elaborate

I just did choco upgrade all, and the cached installers for the previous versions of the upgraded packages weren't deleted.

@ferventcoder
Copy link
Member

cached installers for the previous versions

Ah, cached installers. Not package versions left behind.

@ferventcoder ferventcoder added this to the 0.10.5 milestone Jan 3, 2017
@ferventcoder ferventcoder changed the title Need cleanup command to remove temporary files Jan 3, 2017
@alexchandel
Copy link
Author

Right, they can be hundreds of megabytes, and scattered across dozens of users' temp folders.

Also why not use a global location for cached installers if chocolatey is installed globally? Or better yet, once downloaded, move the cached installers to a cache folder in chocolatey's folder?

Either way a choco cleanup command would be nice so normal chocolatey users don't have to route around in their temp folders.

@ferventcoder
Copy link
Member

Re: Global location - did you miss my response on setting a global temp location by setting the cacheLocation?

@ghost
Copy link

ghost commented Jan 23, 2017

I have 2 GB of cache files. Is it safe to delete everything manually?
If I need to reinstall a program I can download it again.

@ferventcoder
Copy link
Member

@07416 yes, apologies if that is not clear. As long as you are not saying you have 2GB of files including nupkg files in what you consider cache - the "%ChocolateyInstall%\lib" location is not what we would consider cache in this case.

@ghost
Copy link

ghost commented Jan 23, 2017

@ferventcoder The location is ~\AppData\Local\Temp\chocolatey.

@ferventcoder
Copy link
Member

Yep, that's fine.

@mitchmenghi
Copy link

Any update on this im a new user and also noticed that all temp files are there, if they are not needed after an install success there should be a switch to delete or better still some sort of a clean command... :)

@ferventcoder
Copy link
Member

ferventcoder commented Dec 11, 2017

@mitchmenghi This was implemented in Package Reducer, which also comes with choco optimize - https://chocolatey.org/docs/features-package-reducer

This is still on the backlog and determination for how it will be released.

@bcurran3
Copy link

bcurran3 commented Dec 11, 2017

You can also look at https://chocolatey.org/packages/choco-cleaner/0.0.1
(Not intentionally trying to undermine you Rob!)

EDIT: BETTER link: https://chocolatey.org/packages/choco-cleaner

@aaccioly
Copy link

aaccioly commented Dec 18, 2017

I'm glad that I've come across this issue. I'm testing Chocolatey and my ~\AppData\Local\Temp\chocolatey folder had several GBs of cached installers after one day of use. Quite a few of those files were duplicated in lib.

@ferventcoder, I understand that automatic package reduction is a killer feature of the licensed version, however would you please consider releasing at least the cache cleaning command on the community edition?

I'll be glad to buy the pro version or donate to help you keep the good work in Chocolatey. However - and please take this as constructive feedback - all major package managers that I can think of have some kind of clean command (apt, yum, zypper, homebrew, etc). This is basic functionality, I don't think it should be a paid feature.

@ferventcoder ferventcoder modified the milestones: 0.10.10, 0.10.12 Mar 27, 2018
@ferventcoder ferventcoder modified the milestones: 0.10.12, 0.10.13 May 3, 2018
@N3X15
Copy link

N3X15 commented Sep 22, 2018

Really? This is a premium feature?

@ghost
Copy link

ghost commented Nov 28, 2018

You can also look at https://chocolatey.org/packages/choco-cleaner/0.0.1

Why does that package show as rejected?

@bcurran3
Copy link

@07416

I'm glad you brought that up!
v0.0.1 will always show as rejected.
v0.0.2+ is live and well, current version is 0.0.5.1
That link points ONLY to v0.0.1

Anyone in the future reading this thread, please click the following link to jump directly to the current release:
https://chocolatey.org/packages/choco-cleaner

@ferventcoder ferventcoder modified the milestones: 0.10.13, 0.10.14, 0.10.15 Mar 9, 2019
@ferventcoder ferventcoder modified the milestones: 0.10.15, 0.10.16 Apr 1, 2019
@gep13 gep13 modified the milestones: 0.10.16, 0.10.17 May 31, 2019
@black-snow
Copy link

Looking forward to having this feature in the free version.

@ferventcoder ferventcoder modified the milestones: 0.10.17, 0.10.18 Jan 14, 2020
@TheNavyBear
Copy link

I agree with others here. The paid version should have features the free version doesn't, otherwise no one would used the paid version and funding would dry up. However I also feel that cache cleanup is a basic part of any package manager. Maybe a good middle ground would be to have basic cache cleanup (clearing the temp folder) in the free version, and to have all the other reducer/optimizer stuff (reducing NuPKG size, etc) continue being a paid feature. Basic cache cleanup is good for users and it can go a long way in making Chocolatey more favorable in the eyes of users. That's just my two cents.

I thank you all for all the work you do on Chocolatey, and I appreciate having Chocolatey to use. I will always continue to support y'all anytime I can afford to, and I hope y'all keep up the great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment