Reputation: 455
How do I delete a package from chocolatey simple server? Or undo a mistaken choco push?
I'm trying to push a repaired version of an existing package, but I get a 406 error Not Acceptable
I have complete access to the server, but I'm new to chocolatey, so I'm not sure what to do here.
Upvotes: 3
Views: 3970
Reputation: 5243
Please read second answer in here first - it quite well explains version problematics, which you might encounter.
But if you still wish to delete package (maybe accidentally created with wrong id or wrong version) - it's possible using for example nuget tool.
Command line syntax looks like this:
nuget delete <package id> <package version> -s https://<server url>/chocolatey -ApiKey <your API key>
Upvotes: 0
Reputation: 18981
In terms of Chocolatey Packages, once a package version is pushed to a repository, it should be immutable, meaning that it doesn't change. If you modify the contents of a package version you could end up in a situation that person A has version 1.2.3 and person B has version 1.2.3, but they are actually different versions. To that end, the ideal solution would be for you to modify the package version to indicate that there is a change in the packaging. In the context of the Chocolatey Community Repository, we recommend using the package fix notation which is documented here
If you need to fix an approved package for some reason, you can use the fourth version element (aka segment) for a package fix notation. There are two recommended methods of package fix version notation:
- Date (Year/Month/Day) - Some folks use year month day package fix notation (yyyyMMdd as in 20120627 seen as 1.2.0.20120627)
- Sequential - Not recommended - Some folks use sequential numbering (0, then 1, etc as in 0 for no fix, 1 for first fix and so on seen as 1.2.0.0 and 1.2.0.1).
Having said that, if you really need to remove a package from Simple.Server, go the AppData folder, which is here C:\tools\chocolatey.server\App_Data\Packages
by default, and delete the package in question. NOTE: each package folder contains the package versions within it. Only remove the one that you want to replace. Once that is done, you should be able to push the new package version again.
Upvotes: 3