Ways to Uninstall and Install sloccount Ubuntu 22.04

Updated: September 17, 2022

SLOCCount (pronounced “sloc-count”) is a suite of programs for counting physical source lines of code (SLOC) in potentially large software systems (thus, SLOCCount is a “software metrics tool” or “software measurement tool”). SLOCCount can count physical SLOC for a wide number of languages; listed alphabetically, they are: Ada, Assembly, awk, Bourne shell, C, C++, C shell, COBOL, C#, Erlang, Expect, Fortran, Java, lex/flex, LISP (including Scheme), Makefile, Modula3, Objective-C, Pascal, Perl, PHP, Python, Ruby, sed, SQL, Tcl, VHDL, XML, Yacc/Bison. In this guide, I will show you ways to install sloccount Ubuntu 22.04.

Requirements to install

  • Operating system: Ubuntu 22.04 or older Ubuntu versions
  • Privileges: Make sure that you can run the sudo commands line.

Prerequisites to install sloccount on Ubuntu 22.04

Install sloccount Ubuntu 22.04

sloccount 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 sloccount using APT

This is one of the popular ways to install any Ubuntu packages because it’s easy to follow, even if you are a newbie in Linux. Following these steps to install sloccount on your Ubuntu 22.04.

Step 1: Update the APT database to download new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt update

Step 2: Install the package on Ubuntu 22.04. After updating, you can install sloccount Ubuntu by executing this command in the terminal.

sudo apt install sloccount

Install sloccount using Aptitude

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

sudo apt-get install aptitude

After that, you can now install sloccount, just following these steps:

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

sudo apt-get update

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

sudo aptitude -y install sloccount

Uninstall sloccount on Ubuntu 22.04

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

If you installed sloccount using APT or Aptitude, you could uninstall sloccount on Ubuntu by running this command

sudo apt remove --auto-remove sloccount

To uninstall sloccount and remove its data and dependencies, you can also use the following command:

sudo apt autoremove --purge sloccount

Conclusion

In this guide, I showed you ways to install sloccount on Ubuntu 22.04 and ways to uninstall sloccount too. Please do not hesitate to contact me if you require assistance. I’m delighted to respond.