maven-cache-cleanup command not found

In this troubleshooting guide we learn how to fix maven-cache-cleanup command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

maven-cache-cleanup: command not found

or when using sudo you get the following error message

sudo: maven-cache-cleanup: command not found

Solutions to maven-cache-cleanup: command not found

How To Fix maven-cache-cleanup: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu maven-cache-cleanup is provided by maven-cache-cleanup package.

maven-cache-cleanup is:

Maven 3 dropped support for non-unique snapshot versions, which had the side effect of filling up Maven caches on developer machines and on CI build hosts. The Maven Cache Cleanup utility scans a specified Maven cache directory for snapshot versions and deletes all but the latest version of the timestamped artifacts.

To fix this problem, we can install more using the command below.

sudo apt-get -y install maven-cache-cleanup

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install maven-cache-cleanup.

sudo apt -y install maven-cache-cleanup

Or if you have aptitude installed you can use the following command.

sudo aptitude install maven-cache-cleanup

Summary

In this tutorial we learn how to fix maven-cache-cleanup command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.