LinuxCommandLibrary

pkgstats

Show installed package statistics

TLDR

Send installed package data

$ pkgstats submit
copy

View the sent data
$ pkgstats submit [[-d|--dump-json]]
copy

Search for packages
$ pkgstats search [search_term]
copy

Limit search result count (10 by default)
$ pkgstats search [search_term] [[-l|--limit]] [count]
copy

Pick packages for comparison
$ pkgstats show [package1 package2 ...]
copy

Display help
$ pkgstats [[-h|--help]]
copy

SYNOPSIS

pkgstats [OPTIONS]

PARAMETERS

-h, --help
    Show help message and exit.

-v, --version
    Show program's version number and exit.

-a, --all
    Show all available statistics.

-n, --packages
    Show the number of installed packages.

-s, --size
    Show the total disk space occupied by installed packages.

-d, --distribution
    Show distribution of packages by category or origin.

-g, --grouped
    Group statistics by a specified criterion (e.g., repository, section).

-o , --output
    Specify the output format (e.g., text, json, html). Default is text.

DESCRIPTION

pkgstats is a command-line utility designed to analyze and report on the statistics of installed packages on a Linux system. It provides insights into various aspects of package management, such as the number of installed packages, their sizes, the distribution of packages across different categories or origins, and even the age of installed packages. This information can be invaluable for system administrators and users who need to understand their system's software footprint, identify potential bloat, or troubleshoot package-related issues. The command helps visualize and quantify the software installed, making it easier to manage, optimize, and maintain a Linux environment.

By default, pkgstats often focuses on package managers like APT (Debian/Ubuntu) or RPM (Fedora/CentOS/RHEL), but its underlying principles can be extended to other package management systems. The output can be tailored to provide specific metrics, allowing for detailed examination of installed software. This can include identifying the most frequently installed packages, the largest packages, or packages installed from specific repositories. Understanding these statistics can aid in making informed decisions about package removal, upgrades, and overall system configuration.

CAVEATS

The exact options and behavior of pkgstats can vary slightly depending on the specific Linux distribution and the version of the tool installed. It primarily relies on the underlying package manager's metadata, so its accuracy is directly tied to the package manager's data integrity.

Some advanced statistics or grouping options might require specific configurations or additional data sources to be available on the system.

OUTPUT FORMATTING

The ability to output statistics in different formats like JSON or HTML, as supported by the -o option, makes pkgstats adaptable for integration into scripts, reporting tools, or web-based dashboards.

SYSTEM HEALTH AND OPTIMIZATION

By understanding package sizes and distributions, administrators can identify unnecessary packages, optimize disk space, and proactively manage system resources. This contributes to better overall system health and performance.

HISTORY

pkgstats is a utility that has evolved to address the growing need for detailed insights into Linux package management. Initially, users and administrators relied on manual analysis of package manager logs and database files. As systems grew in complexity and the volume of installed software increased, the demand for automated tools to summarize and analyze this data became apparent. pkgstats emerged as a solution, providing a standardized way to extract and present package statistics. Its development has been driven by the desire to simplify system administration, improve resource utilization, and enhance the understanding of software dependencies and installation patterns. It's often found as part of broader system administration toolkits or developed for specific package management ecosystems.

SEE ALSO

apt(8), dpkg(1), rpm(8), yum(8), dnf(8)

Copied to clipboard