How to Uninstall or Install cloc Ubuntu 22.04

Updated: August 30, 2022

Count physical lines of source code in the given files (may be archives such as compressed tarballs or zip files) and/or recursively below the given directories. I will show you how to install cloc on Ubuntu 22.04 in this guide.

Requirements

  • Operating system: Ubuntu 22.04 is needed for cloc to work
  • Privileges: Check that you can run sudo commands.

Prerequisites to install cloc on Ubuntu 22.04

Install cloc Ubuntu 22.04

cloc is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one you believe is simple and easy to follow.

Install cloc using APT

This is one of the most popular methods for installing Ubuntu packages since it is simple to understand, even if you are a Linux novice. Following these instructions to get cloc on your Ubuntu 22.04.

Step 1: Obtain new packages from Ubuntu by updating the APT database. Opening the terminal and executing the following Linux command:

sudo apt -y update

Step 2: Install the package on Ubuntu 22.04. After updating, you can install cloc Ubuntu by pasting this command into the terminal and pressing Enter.

sudo apt-get install cloc

Install cloc using Aptitude

If you didn’t install Aptitude on Ubuntu, you need to install it by executing this command.

sudo apt install aptitude

After installing, you can now install cloc by following these steps:

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt update

Step 2: Start the package installation on Ubuntu 22.04. You can now install cloc Ubuntu by executing this command in the terminal.

sudo aptitude -y install cloc

Uninstall cloc on Ubuntu 22.04

Have you ever thought about how difficult it is to uninstall an application from Ubuntu? You are mistaken; anyone can easily uninstall any program, not just a package.

This command can be used to uninstall cloc from Ubuntu 22.04 if it was installed using APT or Aptitude.

sudo apt remove --auto-remove cloc

If you want to uninstall cloc and delete its data and dependencies, you can also run the following command:

sudo apt autoremove --purge cloc

Ending

In this tutorial, I showed you ways to install cloc on Ubuntu 22.04 and ways to uninstall cloc too. Please contact me if you require any assistance. I’d be delighted to respond.