NugetGallery Auto Delete/Remove Old/Useless Packages Completely From DB and File based
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
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.
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
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.