Artifact Registry lets you delete repositories that you no longer need so
you can remove unused artifacts and avoid ongoing storage costs.

## Before you begin

You must have the Artifact Registry Administrator role or a role with
equivalent [permissions](https://docs.cloud.google.com/artifact-registry/docs/access-control#permissions).

## Deleting repositories

Before you remove a repository, ensure that any packages that you want to keep
are available in another location.

> [!WARNING]
> **Warning:** If you disable the Artifact Registry API or [delete the project](https://docs.cloud.google.com/resource-manager/docs/creating-managing-projects#shutting_down_projects), Artifact Registry services become unavailable. Artifact Registry deletes repository data after 7 days. [Learn more about data deletion on Google Cloud](https://docs.cloud.google.com/docs/security/deletion). If you want to recover deleted repositories, then [Google Cloud Support](https://console.cloud.google.com/support) might be able to help recover deleted Artifact Registry repositories. However, Google Cloud Support can't restore individual images. Data recovery isn't a feature of Artifact Registry and is only performed as a good-will gesture. Google Cloud Support tries to recover Artifact Registry repositories on a best-effort basis. During the process of restoring Artifact Registry repositories, don't try to re-create the repository or push images to it.

When you delete a repository, make sure all references to the
repository are replaced in your build and configuration files.

To delete a repository:

### Console

1. Open the **Repositories** page in the Google Cloud console.

   [Open the Repositories page](https://console.cloud.google.com/artifacts)
2. In the repository list, select the repository to delete.

3. Click **Delete**.

### gcloud

To delete the a repository, run the following command:

```bash
gcloud artifacts repositories delete REPOSITORY \
[--location=LOCATION] [--async]
```

Where

- <var translate="no">REPOSITORY</var> is the name of the repository.
- <var translate="no">`LOCATION`</var> is the regional or multi-regional [location](https://docs.cloud.google.com/artifact-registry/docs/repo-locations) of the repository. You can omit this flag if you set a [default](https://docs.cloud.google.com/artifact-registry/docs/repositories/gcloud-defaults#set).
- `--async` returns immediately, without waiting for the operation in progress to complete.

For more information about the command, run the following command:

     gcloud artifacts repositories delete --help
     ```