Cisco Catalyst 9200 install remove inactive Explained: What It Deletes and When to Use It

On Catalyst 9200 switches in Install mode, install remove inactive frees flash by removing unused installation files. Plan its timing around the image transfer and the committed software state. The command scans the installation directory, identifies packages in use, and lists files for deletion. That list can include BIN images. A newly copied image that has not been added can therefore be deleted during cleanup.

Before removing software files, confirm how the switch boots. See Cisco Catalyst 9200 Install Mode vs Bundle Mode Explained for the files required by each mode.

What install remove inactive removes

install remove inactive

The switch checks the active packages.conf and its package set to identify software files the running installation does not require. Depending on the files and install state, candidates include:

  • Inactive package files from an older or incomplete installation
  • Unused provisioning or configuration files
  • IOS XE .bin image files stored in flash

Files identified as in use should be retained. Review the proposed deletions before confirming.

Inactive-file cleanup positioned before a new image copy, or after upgrade validation and commit
Plan cleanup before copying the new image, or after validating and committing the upgrade.

Why a newly copied BIN can be deleted

Install mode boots from packages.conf and extracted .pkg files. Copying a BIN to flash does not add it to that active installation. For example:

copy tftp: flash:
dir flash:
install remove inactive

The copied image can appear in the deletion list. Cisco advises cleaning up before transferring the new image. Read the full list before answering the prompt. If it includes the new image, answer n and review the sequence.

Cleanup before an upgrade

  1. Confirm the current boot mode and committed install state.
  2. Check flash contents and free space.
  3. Run inactive-file cleanup before transferring the new BIN image.
  4. Review and approve the deletion list.
  5. Copy the new image to flash.
  6. Verify the image file and checksum.
  7. Start the documented install workflow.
show version
show boot
show install summary
dir flash:

install remove inactive

copy tftp: flash:
dir flash:
verify /md5 flash:<IMAGE-FILE>

Use the transfer method and checksum command in the approved maintenance procedure, with Cisco's published image information.

Reading the deletion list

The scan identifies files in use and proposes deletions before requesting confirmation:

Cleaning flash:
Scanning boot directory for packages ... done.
Preparing packages list to delete ...

<ACTIVE-PACKAGE>
  File is in use, will not delete.

The following files will be deleted:
<INACTIVE-OR-UNUSED-FILE>

Do you want to remove the above files? [y/n]

Check both sections:

  • File is in use, will not delete: the switch has identified a file required by the active installation.
  • The following files will be deleted: these are the actual deletion candidates and must be reviewed before confirmation.

Check every BIN, PKG, and CONF candidate against the current software, planned upgrade, and recovery requirements.

Active software files retained while proposed BIN, PKG, and CONF deletion candidates require review
A newly copied BIN can appear in the deletion list. Review every candidate before confirming.

Cleanup after an upgrade

Validate and commit the new release before post-upgrade cleanup. Check:

show version
show boot
show install summary
dir flash:

Confirm:

  • The expected IOS XE release is running.
  • The switch is in Install mode.
  • The boot variable points to flash:packages.conf.
  • show install summary reports state C, meaning Activated and Committed.
  • Basic switching, uplinks, management access, and required services are operating normally.

Then review the cleanup list and approve only files no longer required for the recovery plan.

An observed C9200L cleanup result

During a standalone C9200L upgrade from IOS XE 17.9.4a to 17.18.4, inactive-file cleanup ran during preparation before the target BIN was copied. After the upgrade, Install mode, the flash:packages.conf boot variable, and state C were verified. Cleanup ran again after those checks.

  • Free space immediately after the upgrade: approximately 300 MB
  • Free space after post-upgrade cleanup: approximately 1.2 GB

These figures apply to that switch and maintenance event. Results vary with the platform, stack, release, and flash contents.

For the complete upgrade sequence, see Cisco Catalyst 9200L Upgrade: Fixing “Super Package Already Added”.

An already-added package set

This message reports an already-added package set:

Super package already added. Add operation not allowed.

Cisco documents install remove inactive as an option to discard an added inactive package set and restart installation. Check the state first:

show install summary
show install inactive
show install log

If the correct target packages are ready for activation, the maintenance plan may call for continuing from that stage. Deleting them would restart work already completed.

When to pause cleanup

Pause cleanup when:

  • A new BIN image has already been copied but not yet added.
  • The switch is activated but uncommitted, shown as state U.
  • An install operation or rollback decision is still in progress.
  • The inactive package set may be needed to continue a staged upgrade.
  • The recovery or rollback requirements have not been confirmed.
  • You have not reviewed the proposed deletion list.
Conditions for pausing cleanup: an unadded new BIN, state U, an ongoing install, or unconfirmed recovery needs
Pause cleanup when the required image, install state, or recovery plan is not settled.

Cleanup checklist

  1. Verify the current IOS XE version and boot mode.
  2. Check show install summary for I, U, C, or D states.
  3. Confirm the boot variable and active packages.conf.
  4. Check whether a newly copied BIN file must be preserved.
  5. Run install remove inactive.
  6. Read the entire deletion list.
  7. Cancel if any required image or rollback file is listed.
  8. After cleanup, verify free space and the install state again.

When to confirm deletion

The files selected by install remove inactive depend on the current install state and flash contents. Clean up before copying a new BIN, or after validating and committing an upgrade. Review every deletion candidate before answering y.

References

Removing software files affects upgrade, rollback, and recovery options. Check the platform, release, boot mode, install state, and approved maintenance procedure before confirming deletion.

Comments

Popular posts from this blog

Alteon Sessions Show Established, but HTTPS Authentication Fails Intermittently

Cisco Catalyst 9200L Upgrade: Fixing “Super Package Already Added”

Cisco Nexus show logging server Explained: Status, Severity, Facility, VRF, and Port