How To Install sloccount on Debian 12

Learn how to install sloccount on Debian 12 with this tutorial. sloccount is programs for counting physical source lines of code (SLOC)

Introduction

In this tutorial we learn how to install sloccount on Debian 12.

What is sloccount

sloccount is:

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.

SLOCCount can automatically determine if a file is a source code file or not, and if so, which language it’s written in. As a result, you can analyze large systems completely automatically. SLOCCount also includes some report-generating tools to collect the data generated and present it in several different formats.

There are three methods to install sloccount on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install sloccount Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install sloccount using apt-get by running the following command:

sudo apt-get -y install sloccount

Install sloccount Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install sloccount using apt by running the following command:

sudo apt -y install sloccount

Install sloccount Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install sloccount using aptitude by running the following command:

sudo aptitude -y install sloccount

How To Uninstall sloccount on Debian 12

To uninstall only the sloccount package we can use the following command:

sudo apt-get remove sloccount

Uninstall sloccount And Its Dependencies

To uninstall sloccount and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove sloccount

Remove sloccount Configurations and Data

To remove sloccount configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge sloccount

Remove sloccount configuration, data, and all of its dependencies

We can use the following command to remove sloccount configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge sloccount

Dependencies

sloccount have the following dependencies:

References

Summary

In this tutorial we learn how to install sloccount package on Debian 12 using different package management tools: apt, apt-get and aptitude.