SFDX: how to delete a package

It cannot currently be done by you. Perhaps Salesforce support could do it if you contacted them.

You can uninstall the package from various orgs as suggested by the previous answer. That does not eliminate the package from your package list.

sfdx force:package:list

... will still show the package even if it is uninstalled from all orgs.

I have created an idea to add this capability to the SFDX cli on the idea exchange. Go vote for it. https://success.salesforce.com/ideaView?id=0873A000000lMYmQAM


These are the all available package command which we have right now. package Commands.

As of now, we don't have any command which can do this task so you need to manually delete the package from UI. Also the sfdx force:package:create is still in beta so SF might give this command in future but as of now, There is no option available.


Winter '21 release enables package and version deletion:

sfdx force:package:version:delete

sfdx force:package:delete

Do take into account that deleted packages or package versions can’t be recovered, or specified as a dependency, and any new installations of the package will fail.

Released versions of second-generation managed packages can’t be deleted.

More details here.