获取某些包使用了多少空间

获取某些包使用了多少空间

我想知道我的 LaTeX 安装使用了多少空间。我尝试这样做,apt但我不确定这是否可能。我想做的是有一个像这样的命令

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

输出

128 MB

当然,这个show-install-size不存在。

答案1

二进制斯塔的评论dpkg-query适用于已安装的软件包。如果您在安装软件包之前考虑大小,可以使用aptapt-cache

apt show。或apt-cache show给出一个Installed-Size:字段

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.

你可以:

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

或对于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
...

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.
...

答案2

请看一下dpkg 查询

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

对于基于 rpm 的发行版

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

输出

264106951 firefox 
256914779 linux-firmware 
235327481 google-chrome-stable 
222208346 glibc-all-langpacks 
177040404 docker-ce-cli 

答案3

您看过 aptitude ( apt-get install aptitude) 吗?它是软件包的用户界面,显示下载和安装的大小。但它不是命令行界面......

相关内容