Debian
從 Debian 下載時有沒有辦法查詢源文件的大小?
當我們跑步時
apt
,apt-get
或者aptitude
我們總是知道需要多少空間/
以及它的孩子(/home/$username
當然除外)。現在,當我們
apt-get source
(在使用者空間中)進行操作時,在下載源文件之前無法知道它們的大小,以免在最後一刻遇到任何意外。我會分享一個真實的例子來描述這個問題。
二進制未知範圍大約是 305 MB 未壓縮 -
[$] aptitude show unknown-horizons Package: unknown-horizons Version: 2014.1+git160920-1 State: installed Automatically installed: no Priority: optional Section: games Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org> Architecture: all Uncompressed Size: 305 M Depends: ttf-unifont, python, python-enet, python-fife (>= 0.3.5+git160920), python-yaml, python:any (< 2.8), python:any (>= 2.7.5-5~) Description: 2D realtime strategy simulation Unknown Horizons is a 2D realtime strategy simulation with an emphasis on economy and city building. Expand your small settlement to a strong and wealthy colony, collect taxes and supply your inhabitants with valuable goods. Increase your power with a well balanced economy and with strategic trade and diplomacy. Homepage: http://www.unknown-horizons.org
現在,如果我要下載原始碼,它要麼下載整個 305 MB 或更多的未壓縮包,要麼只是下載
/debian
幾乎不會超過 MB 或更多的目錄。有沒有辦法做到這一點 ?我猜它要麼需要像
apt-file
這樣的元數據 -$ sudo apt-file update
您可以使用以下命令找出源 tarball 的大小
apt-cache showsrc
:$ apt-cache showsrc unknown-horizons Package: unknown-horizons Binary: unknown-horizons Version: 2014.1+git160920-1 Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org> Uploaders: Christoph Egger <christoph@debian.org> Build-Depends: debhelper (>= 10), dh-python, docbook-xml, docbook-xsl, imagemagick, intltool, python, xsltproc Architecture: all Standards-Version: 3.9.8 Format: 3.0 (quilt) Files: 152652f8ecb6961a5f02d3cab67b8cfa 2290 unknown-horizons_2014.1+git160920-1.dsc bec6e49f621f3f961454cf41c7e13346 197217496 unknown-horizons_2014.1+git160920.orig.tar.xz dccaafd51d0fbe3aaebe874715bc1d93 12512 unknown-horizons_2014.1+git160920-1.debian.tar.xz Vcs-Browser: https://anonscm.debian.org/cgit/pkg-games/unknown-horizons.git Vcs-Git: https://anonscm.debian.org/git/pkg-games/unknown-horizons.git Checksums-Sha256: af9fc7592567b75fa84189ca4e823df103e74fcb51e3fe34ea1162a53d08434d 2290 unknown-horizons_2014.1+git160920-1.dsc 9342154d2ede6e152175c1c69d84f3a51ba2704a77a286103590da40f0d02482 197217496 unknown-horizons_2014.1+git160920.orig.tar.xz c6db7500f4dfe4a544ae660f92dd9acdc8248ecdc798a45d4bce0be6992d8a6f 12512 unknown-horizons_2014.1+git160920-1.debian.tar.xz Homepage: http://www.unknown-horizons.org Package-List: unknown-horizons deb games optional arch=all Directory: pool/main/u/unknown-horizons Priority: source Section: games
注意
Files:
條目:.orig
tarball(包含上游源)大小為 188MiB,.debian
tarball 為 12KiB。這並沒有告訴您提取 tarball 需要多少空間,但它提供了一些指示。您可以
debian
通過僅下載 tarball 來僅下載目錄,.debian
無論是從源包的頁面,還是使用apt-get source --diff-only
.