Knowing how big a package is with and without dependencies is a handy metric
to have before installing something.
Sometimes when thinking about installing a few comparable packages but only
picking one, I’ll be curious about how big a package is. I don’t always
optimize for extreme minimalism but it’s something I’m generally mindful of.
If you want to see the true install size you can start to install it but then
cancel with n:
$ pacman -Syu swaybg
Package (1) New Version Net Change Download Size
extra/swaybg 1.2.1-1 0.03 MiB 0.01 MiB
Total Download Size: 0.01 MiB
Total Installed Size: 0.03 MiB
:: Proceed with installation? [Y/n]
On my system, swaybg’s dependencies didn’t need to be installed because I
already have them. The same thing happened with swww so in this case the true
install size is the package size reported above.
Confirm a Dependency is Installed
You can run pacman -Q | grep cairo or whatever package you want to check. If
you get a grep response back it’s already installed:
To get the true install size, can also start installing a package but cancel
it:
$ apt-get install --no-install-recommends curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libbrotli1 libcom-err2 libcurl4t64 libffi8 libgnutls30t64 libgssapi-krb5-2 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap2 libnghttp2-14 libnghttp3-9 libp11-kit0 libpsl5t64 librtmp1 libsasl2-2 libsasl2-modules-db libssh2-1t64 libtasn1-6
libunistring5
Suggested packages:
gnutls-bin krb5-doc krb5-user
Recommended packages:
bash-completion ca-certificates krb5-locales libldap-common publicsuffix libsasl2-modules
The following NEW packages will be installed:
curl libbrotli1 libcom-err2 libcurl4t64 libffi8 libgnutls30t64 libgssapi-krb5-2 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap2 libnghttp2-14 libnghttp3-9 libp11-kit0 libpsl5t64 librtmp1 libsasl2-2 libsasl2-modules-db libssh2-1t64 libtasn1-6
libunistring5
0 upgraded, 23 newly installed, 0 to remove and 2 not upgraded.
Need to get 4905 kB of archives.
After this operation, 14.8 MB of additional disk space will be used.
Do you want to continue?
Keep in mind I ran the apt examples on a fresh Docker container with docker container run -it --rm debian:stable where I only ran apt-get update. On a
real system, you may already have some of curl’s dependencies installed. The
same goes with wget.
The video below demonstrates running the above commands.
1:21 – Seeing the true install size with dependencies
2:06 – Double checking if a dependency is installed
2:33 – Confirming with a larger package I don’t have installed
3:15 – Comparing package sizes with apt
4:40 – Seeing the true install size with apt
How often do you use disk space as a deciding factor? Let me know below.
Like you, I'm super protective of my inbox,
so don't worry about getting spammed. You can expect a few emails per year (at most), and
you can 1-click unsubscribe at any time. See what else you'll get too.