# What should I check before deleting a Pkg package?

Company: Socra — Multiply Your Judgment
Canonical URL: https://support.socra.com/articles/art_01m46em5qbjyyyj3eknmf9dhz9-delete-a-package

Check who uses the package and keep any source or artifacts you need before deleting it. Pkg deletes the Package and its Change, Checkpoint, dependency, Release, and distribution-tag records. It also removes the Package's managed source resources.

Deletion can break applications that still install the package's versions. Copies already downloaded remain usable; deletion cannot recall them. Do not use deletion to hide a package temporarily or replace one immutable version.

## Confirm the Package

Use the Socra CLI with the Account and Pkg plugins, signed in to the owning Account. Replace `PACKAGE` with the exact package name or `pkg_…` ID:

```sh
socra pkg retrieve PACKAGE
socra pkg change list PACKAGE
socra pkg release list PACKAGE
```

Check the Package's ID and visibility. Keep the ID so you can verify this same Package after deletion. Follow each list's returned `--after` cursor until you have checked the relevant records.

Pkg rejects deletion while the Package has an active Change or Release. Check the active record using its returned `pchg_…` or `prel_…` ID:

```sh
socra pkg change retrieve PACKAGE CHANGE_ID
socra pkg release retrieve PACKAGE RELEASE_ID
```

Replace the record ID in the relevant command. Wait for active work to finish before deleting the Package.

## Check consumers

Pkg rejects deletion with `Package is still used by workspace dependencies` when another managed Package depends on it. Update and verify those consumers before removing their dependency edges.

This guard covers the dependencies recorded in Pkg. Check external applications, build systems, and lockfiles separately. Move consumers to a replacement before deleting a package they still need.

## Delete and verify

Once the Package is no longer needed, run:

```sh
socra pkg delete PACKAGE
```

Retrieve the saved `pkg_…` ID again. `Package not found` confirms that this Package is no longer available. A package name can also exist in another Account, so the ID is the reliable way to check the Package you deleted.

If deletion fails, inspect the Package and the error before retrying. Removal includes more than one resource, so some source resources may already have been removed.

The Pkg CLI has no restore command. Keep the source and release artifacts you need before deletion. Pkg does not delete the stored artifact bytes through this command, but it removes the Release records used to serve them; retained storage is not a restore interface.

## Article details

- Collection: [Pkg](https://support.socra.com/collections/col_01m3z6vv74g6nshqaz3wpy8704-pkg)
- Canonical: https://support.socra.com/articles/art_01m46em5qbjyyyj3eknmf9dhz9-delete-a-package
