Install Kondo Dependencies Cleaner on Ubuntu 24.04

Install Kondo Dependencies Cleaner on Ubuntu 24.04

Kondo is a command line tool designed specifically for cleaning dependencies and artifacts from projects. It supports various project types like Node.js, Composer, CMake, etc., and removes directories such as node_modules, vendor, cmake-build-release, build, and others. It can be useful when you want to back up the code but exclude large amounts of dependencies. This tutorial explains how to install Kondo dependencies cleaner on Ubuntu 24.04.

Install Kondo

Download Kondo archive file:

wget -qO kondo.tar.gz https://github.com/tbillington/kondo/releases/latest/download/kondo-x86_64-unknown-linux-gnu.tar.gz

Extract executable to /usr/local/bin directory:

sudo tar xf kondo.tar.gz -C /usr/local/bin kondo

Clean up unneeded file:

rm -rf kondo.tar.gz

Testing Kondo

To use Kondo, run the kondo command by specifying project directory. For example:

kondo myproject

Kondo will analyze the project, identifies a directory of dependencies such as node_modules, and prompt you for action:

/home/adminer/myproject Node project (30 seconds ago)
  └─ node_modules (10.6MiB)
  delete above artifact directories? ([y]es, [n]o, [a]ll, [q]uit): 

Type y to confirm the deletion. The output will indicate the amount of disk space reclaimed:

Projects cleaned: 1, Bytes deleted: 10.6MiB

Uninstall Kondo

To uninstall Kondo, delete the associated file:

sudo rm -rf /usr/local/bin/kondo

Leave a Comment

Cancel reply

Your email address will not be published.