0

I would like to know how much space is used my LaTeX install. I tried to do with apt but I am not sure it's possible. What I would like to do is to have a command like

apt-cache list --show-install-size texlive*

outputing

128 MB

and of course the show-install-size doesn't exist.

  • Does this answer your question? [Which installed software packages use the most disk space on Debian?](https://unix.stackexchange.com/questions/40442/which-installed-software-packages-use-the-most-disk-space-on-debian) - `dpkg-query -Wf '${Installed-Size}\t${Package}\n' texlive-full` (or whichever `texlive` package it is), `aptitude search --display-format '%p %I' texlive`, or `apt-cache show texlive-full | grep Installed-Size`, ... – muru May 22 '20 at 17:43

3 Answers3

3

Per binarysta's comment, dpkg-query works well for installed packages. If you are considering size before installing a package, you can use apt or apt-cache.

apt show. or apt-cache show gives an Installed-Size: field

stew ~ $ apt show texlive
Package: texlive
Version: 2020.20200417-1
Priority: optional
Section: tex
Source: texlive-base
Maintainer: Debian TeX Maintainers <[email protected]>
Installed-Size: 72.7 kB
Depends: texlive-fonts-recommended (>= 2020.20200417), texlive-latex-base (>= 2020.20200417), texlive-latex-recommended (>= 2020.20200417)
Homepage: http://www.tug.org/texlive/
Tag: made-of::tex, role::app-data, role::program, use::typesetting,
 works-with-format::tex, works-with::text
Download-Size: 33.4 kB
APT-Manual-Installed: no
APT-Sources: http://ftp.debian.org/debian testing/main amd64 Packages
Description: TeX Live: A decent selection of the TeX Live packages
 The TeX Live software distribution offers a complete TeX system. It
 encompasses programs for typesetting, previewing and printing of TeX
 documents in many different languages, and a large collection of TeX macros
 and font libraries. . This metapackage provides a decent selection of the
 TeX Live packages which should suffice for the most common tasks. . The
 distribution also includes extensive general documentation about TeX, as
 well as the documentation accompanying the included software packages.

You could:

$ apt-cache show texlive | grep Installed-Size
Installed-Size: 72.7 kB

or for texlive*:

$ apt-cache show texlive* | grep -E 'Package:|Installed-Size:'
Package: texlive-fonts-recommended
Installed-Size: 15029
Package: texlive-lang-portuguese
Installed-Size: 16440
Package: texlive-latex-recommended
Installed-Size: 31735
Package: texlive-base
Installed-Size: 74760
...

from man apt(8):

SYNOPSIS
       apt ... {list | search | show | ...}... 

...
       show (apt-cache(8))
           Show information about the given package(s) including its dependencies, installation and
           download size, sources the package is available from, the description of the packages
           content and much more. It can e.g. be helpful to look at this information before allowing
           apt(8) to remove a package or while searching for new packages to install.
...
Stewart
  • 12,628
  • 1
  • 37
  • 80
  • Why the installed-size is `72.7 kB` when it is actually close to `3 GB`? – ado sar Oct 02 '22 at 10:26
  • `texlive` is not 3GB. – Stewart Oct 03 '22 at 08:44
  • I don't know the exact size, but for sure is not `72.7 kB` which is reported by `apt show`. Therefore, `Installed-Size` doesn't provide any useful information. – ado sar Oct 03 '22 at 15:50
  • `texlive` itself is a tiny package which only contains copyright notices and bug scripts. Its real value is the dependencies it pulls in: `texlive-latex-base` (11.5MB), `texlive-latex-recommended` (31.3MB) and `texlive-fonts-recommended` (15.4MB). Those have even more dependencies such as `texlive-latex-base` depending on `texlive-base` (43.4MB) which depends on `texlive-binaries` (50.3MB) which depends on `libc6` (13.1MB) which depends on `libgcc-s1` (119kB). How deep you want to go is up to you. If you're interested in only packages that aren't installed, `apt` tells you on install. – Stewart Oct 04 '22 at 14:16
1

Please have a look at dpkg-query

dpkg-query -Wf '${Installed-Size}\t${Package}\n'

For rpm-based distros

rpm -qa --queryformat '%{SIZE} %{NAME} \n'

Output

264106951 firefox 
256914779 linux-firmware 
235327481 google-chrome-stable 
222208346 glibc-all-langpacks 
177040404 docker-ce-cli 
binarysta
  • 2,912
  • 10
  • 14
0

Have you had a look at aptitude (apt-get install aptitude)? It is a user interface to packages, and it shows the download and install size. It is not a command line interface though....

ruud
  • 253
  • 2
  • 8