| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Show largest installed packages.
curl https://raw.githubusercontent.com/SharUpOff/pkgtop/main/dist/pkgtop.sh -so - | sudo tee /usr/local/bin/pkgtop > /dev/nullsudo chmod 755 /usr/local/bin/pkgtoppkgtopOutput:
libc6.............................................................. 13.27 MiB perl-base.......................................................... 7.59 MiB coreutils.......................................................... 6.95 MiB dpkg............................................................... 6.58 MiB libssl3............................................................ 5.69 MiB apt................................................................ 4.06 MiB util-linux......................................................... 3.32 MiB libapt-pkg6.0...................................................... 3.10 MiB libstdc++6......................................................... 2.69 MiB libc-bin........................................................... 2.48 MiB
The colour output makes it possible to compare installed packages visually:
$ pkgtop [lines [columns]] [--skip <count>] [--exclude <name>] [--mark <name>] [--other] [--total] [--all] [--raw] [--version] [--help]$ pkgtop 5
libc6.............................................................. 13.27 MiB
perl-base.......................................................... 7.59 MiB
coreutils.......................................................... 6.95 MiB
dpkg............................................................... 6.58 MiB
libssl3............................................................ 5.69 MiB $ pkgtop 5 42
libc6........................ 13.27 MiB
perl-base.................... 7.59 MiB
coreutils.................... 6.95 MiB
dpkg......................... 6.58 MiB
libssl3...................... 5.69 MiB $ pkgtop 5 --other
[other]............................................................ 61.35 MiB
libc6.............................................................. 13.27 MiB
perl-base.......................................................... 7.59 MiB
coreutils.......................................................... 6.95 MiB
dpkg............................................................... 6.58 MiB $ pkgtop 5 --other --total
[other]............................................................ 67.93 MiB
libc6.............................................................. 13.27 MiB
perl-base.......................................................... 7.59 MiB
coreutils.......................................................... 6.95 MiB
[total]............................................................ 95.74 MiB $ pkgtop 5 --other --total --skip 2
[other]............................................................ 55.67 MiB
coreutils.......................................................... 6.95 MiB
dpkg............................................................... 6.58 MiB
libssl3............................................................ 5.69 MiB
[total]............................................................ 74.87 MiB $ pkgtop 5 --other --total --exclude libc6
[other]............................................................ 61.35 MiB
perl-base.......................................................... 7.59 MiB
coreutils.......................................................... 6.95 MiB
dpkg............................................................... 6.58 MiB
[total]............................................................ 82.46 MiB $ pkgtop 5 --other --total --exclude libc6 --exclude coreutils
[other]............................................................ 55.67 MiB
perl-base.......................................................... 7.59 MiB
dpkg............................................................... 6.58 MiB
libssl3............................................................ 5.69 MiB
[total]............................................................ 75.52 MiB $ pkgtop 5 --other --total --mark coreutils
[other]............................................................ 67.93 MiB
libc6.............................................................. 13.27 MiB
perl-base.......................................................... 7.59 MiB
coreutils.......................................................... 6.95 MiB<
[total]............................................................ 95.74 MiB $ pkgtop 5 --other --total --mark coreutils --mark [other]
[other]............................................................ 67.93 MiB<
libc6.............................................................. 13.27 MiB
perl-base.......................................................... 7.59 MiB
coreutils.......................................................... 6.95 MiB<
[total]............................................................ 95.74 MiB$ pkgtop --all
libc6.............................................................. 13.27 MiB
perl-base.......................................................... 7.59 MiB
...
libtirpc-common.................................................... 32.00 KiB
libaudit-common.................................................... 23.00 KiB ⚠️ Use zsh on macOS. This script uses associative arrays introduced in bash >= 4, while macOS have only 3.X.X.
zsh pkgtop.shYou may want to install expac to improve script performance:
$ time pkgtop &> /dev/null
real 0m0,576s
user 0m0,527s
sys 0m0,067s
$ sudo pacman -S expac
$ time pkgtop &> /dev/null
real 0m0,391s
user 0m0,245s
sys 0m0,120s🛠 You are welcome to add support for other distributions, fix bugs or improve functionality. Please, do not forget to add tests.
docker compose -f docker-build.yml run --rm buildCreate a plugin file src/includes/distributions/yourdistro/01_package-manager.sh
# YourDistro (package-manager)
if command -v package-manager &> /dev/null; then
# write installed packages to the STDOUT using format: %{bytes}d %{name}s\n
package-manager --installed --format='%{bytes}d %{name}s\n'
# prevent other plugins from running
exit $?
fiCreate a plugin file src/includes/multiplatform/yourpackagesystem/01_package-manager.sh
# YourPackageSystem (package-manager)
if command -v package-manager &> /dev/null; then
# write installed packages to the STDOUT using format: %{bytes}d %{name}s\n
package-manager --installed --format='%{bytes}d %{name}s\n'
# other plugins can also be run to combine the results
fiYor plugin should write installed packages using format %{bytes}d %{name}s\n to the STDOUT:
2131 foo
34534 barThere are some regression tests provided for compatible distributions.
docker compose -f docker-tests-run.yml upOutput:
pkgtop-test-ubuntu-22.04-1 exited with code 0
pkgtop-test-ubuntu-20.04-1 exited with code 0
...bash ./dist/pkgtop.sh 25 80 | diff ./data/ubuntu-22.04.txt -docker compose -f docker-tests-update.yml up| Back | FazBrowse Home | New Git URL |