---
name: "dnf5-clean"
section: "8"
platform: "linux"
package: "dnf5"
version: "5.4.6.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/dnf5-clean"
---

# dnf5-clean(8)

Clean Command

## NAME

dnf5-clean - Clean Command

## SYNOPSIS

**dnf5 clean \[options\] \<cache\_types\>...**

## DESCRIPTION

The **clean** command in **DNF5** is used to delete temporarily kept repository metadata or marking the cache expired.

Arguments in **cache\_types** specify which types of the cached data to cleanup:

- ***all***

  ```
  Delete all temporary repository data from the system.
  ```

- ***packages***

  ```
  Delete any cached packages.
  ```

- ***metadata***

  ```
  Delete repository metadata.
  This will delete the files which DNF5 uses to determine the remote availability of packages.
  Using this option will make DNF5 download all the metadata the next time it is run.
  ```

- ***dbcache***

  ```
  Delete cache files generated from the repository metadata.
  This forces DNF5 to regenerate the cache files the next time it is run.
  ```

- ***expire-cache***

  ```
  Mark the repository metadata expired.
  This forces DNF5 to check the validity of the cache the next time it is run.
  ```

## EXAMPLES

- **dnf5 clean all**

  ```
  Cleanup all repository cached data.
  ```

- **dnf5 clean packages dbcache**

  ```
  Cleanup all cached packages and dbcache metadata.
  ```

## Author

See AUTHORS.md in dnf5 source distribution.

## Copyright

Contributors to the dnf5 project.
