Skip to main content

This version of GitHub Enterprise Server was discontinued on 2024-03-26. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise Server. For help with the upgrade, contact GitHub Enterprise support.

Deleting and restoring a package

Learn how to delete or restore a package.

Package deletion and restoration support on GitHub

On GitHub if you have the required access, you can delete:

  • an entire private package
  • an entire public package, if there's not more than 5000 downloads of any version of the package
  • a specific version of a private package
  • a specific version of a public package, if the package version doesn't have more than 5,000 downloads

Note:

  • You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact us through the GitHub Support portal for further assistance.
  • When deleting public packages, be aware that you may break projects that depend on your package.

On GitHub, you can also restore an entire package or package version, if:

  • You restore the package within 30 days of its deletion.
  • The same package namespace is still available and not used for a new package.

Packages API support

For certain registries, you can use GraphQL to delete a version of a private package.

You cannot use the GitHub Packages GraphQL API with registries that support granular permissions. For the registries that only support repository-scoped permissions, and can be used with the GraphQL API, see "About permissions for GitHub Packages."

Required permissions to delete or restore a package

With registries that support granular permissions, you can choose to allow packages to be scoped to a user or an organization, or linked to a repository.

To delete a package that has granular permissions separate from a repository, such as container images stored at https://containers.HOSTNAME/NAMESPACE/PACKAGE-NAME (where NAMESPACE is the name of the personal account or organization to which the package is scoped), you must have admin access to the package. For more information, see "About permissions for GitHub Packages."

For packages that inherit their access permissions from repositories, you can delete a package if you have admin permissions to the repository.

Some registries only support repository-scoped packages. For a list of these registries, see "About permissions for GitHub Packages."

Deleting a package version

Deleting a version of a repository-scoped package on GitHub

To delete a version of a repository-scoped package, you must have admin permissions to the repository in which the package is published. For more information, see "Required permissions."

  1. On your GitHub Enterprise Server instance, navigate to the main page of the repository.

  2. In the right sidebar of your repository, click Packages.

    Screenshot of the sidebar of a repository page. The "Packages" section is outlined in orange.

  3. Search for and then click the name of the package that you want to manage.

  4. Navigate to where you can manage versions for your type of package.

    • If your package is a container, under the "Recent Versions" section, click View and manage all versions. Screenshot of a package's "Recent Versions" section. Underneath, the "View and manage all versions" link is highlighted with an orange outline.
    • For types of packages other than containers:
      1. On the right-hand side, click Package settings. Screenshot of a package's landing page. In the lower right corner, "Package settings" is highlighted with an orange outline.
      2. On the left click Manage versions. Screenshot of a package's "Manage versions" menu. In the lower right corner, "Manage versions" is highlighted with an orange outline.
  5. In the list of packages, find the version of the package that you want to delete.

    • If your package is a container, to the right of the package version click , then select Delete version from the dropdown menu. Screenshot of a package version with a dropdown menu button, labeled with a kebab icon. The "Delete version" link in the menu is highlighted with an orange outline.