Friday, February 3, 2017

[Quick Tips: Installed Apps Info]: How To Find Installed Applications With Installed Size In Linux

How To Find Installed Applications With Installed Size In Linux

There might be many ways to do this, but I prefer the following three.

1. Find installed applications with size using Synaptic package manager

In Ubuntu and its derivatives, we can easily find it using Synaptic package manager. If your system don’t have synaptic, install it as shown below.
sudo apt-get install synaptic
Once installed, go to Settings -> Preferences and click on “Columns and Fonts” tab. Then, check the column boxes named “Size” and “Download size”.
After enabling those columns, go back to the main screen of Synaptic, and click on Status tab on the left and choose “Installed” option. You will there see the installed applications along with their size.

2. Find installed applications with size From Terminal

On Debian, Ubuntu, Linux Mint:
sudo dpkg-query -Wf '${Installed-size}\t${Package}\n' | column -t
Sample output:
140 xserver-xorg-video-siliconmotion
98 xserver-xorg-video-sisusb
87 xserver-xorg-video-tdfx
161 xserver-xorg-video-trident
50 xserver-xorg-video-vesa
.
.
.
157 zeitgeist-datahub
350 zenity
1716 zenity-common
573 zip
157 zlib1g
On RHEL, CentOS, Fedora, run:
sudo rpm -qa --queryformat '%10{size} - %-25{name} \t %{version}\n' | sort -n
Here, the “%10{size}” indicates that the size should be aligned right and padded by 10 characters. The “%-25{name}” sets the package name to be aligned left and padded to 25 characters. Finally, “sort” will sort the result line as per the specified numeric value (-n).
Sample output:
This command will display the installed packages by size. Largest packages packages will be displayed last.
 0 - basesystem 10.0
 0 - filesystem 3.2
 0 - gpg-pubkey 352c64e5
 0 - gpg-pubkey f4a80eb5
 0 - libreport-filesystem 2.1.11
 180 - selinux-policy 3.13.1
 599 - rootfiles 8.1
 .
 .
 .
 120273417 - glibc-common 2.17
 132737027 - kernel 3.10.0
 132756803 - kernel 3.10.0
 142671431 - kernel 3.10.0
 142686493 - kernel 3.10.0

3. Find installed applications with size using Pacgraph

Pacgraph visualizes the installed applications in a pretty graph. It was originally developed for Arch Linux and its derivatives. Now, it is ported to other distros as well.
To install it in Arch Linux and its derivatives, run:
sudo pacman -S pacgraph
On Ubuntu 16.04:
sudo apt-get install pacgraph
Well, we have installed pacgraph. Let us now see how to find the installed applications withe disk space consumed by them using command:
sudo pacgraph -c
Sample output:
Here is the sample output from my Arch Linux desktop. The largest packages will be shown first.
Autodetected Arch.
Loading package info
warning: ttf-font found in ['ttf-dejavu-ib', 'ttf-liberation-ib', 'ttf-oxygen'], assuming ttf-dejavu-ib
Total size: 6968MB
563MB qt5-examples
541MB libreoffice-fresh
337MB virtualbox
206MB go-tools
.
.
.
27648B which
27648B acpi
24576B caja-open-terminal
5120B systemd-sysvcompat
If your system has graphical DE, you can easily display the graph of all installed packages by running:
pacgraph-tk

No comments: