NuGetGallery icon indicating copy to clipboard operation
NuGetGallery copied to clipboard

NugetGallery Auto Delete/Remove Old/Useless Packages Completely From DB and File based

Open WaelBassem opened this issue 6 years ago • 3 comments

Hello,

I'm struggling to find the right way to clean my server from obsolete/useless packages with automated way. I have do it from admin side one by one which is really painful. I tried API and client CMD (nuget.exe) but couldn't delete the package from server file storage and DB permanently.

Could you help on that?

Regards, Wael

WaelBassem avatar Apr 11 '19 14:04 WaelBassem

Running nuget delete unlists a package from the Gallery. The package is hidden on the UI, but you can still download it if you know its id and version. The only way to actually delete the package is using the gallery’s admin tools. We do not have any plans to support deletions from the command line.

loic-sharma avatar Apr 11 '19 17:04 loic-sharma

Also I'd consider looking at BaGet as it supports package deletion when running nuget delete. See: https://loic-sharma.github.io/BaGet/configuration/#enabling-package-hard-deletions

loic-sharma avatar Apr 11 '19 17:04 loic-sharma

Hi @WaelBassem , as @loic-sharma explained we currently don't support deleting packages from command line even for private Gallery deployments. However, if you would like to send us a pull request with this functionality we will accept it. I recommend the following: add a setting to web.config that will control if the nuget delete command causes "unlist" (like it does now) or actual deletion. I can provide additional details and pointers to code if interested.

skofman1 avatar Apr 17 '19 00:04 skofman1