Wednesday, August 31, 2016

command line - How to determine the size of a package while using apt prior to downloading?



When using apt-get install , and there are dependencies that need to be downloaded, the terminal outputs names of additional packages and total size, and asks for confirmation before downloading.




But, when dependencies are satisfied and nothing but the named package needs to be downloaded there is no size output and no confirmation.



When using Synaptic, I can see the total size that new packages that will use after installation but no way to see the size that needs to be downloaded, except to go from package to package and use properties to see the compressed size.



I would like to know if there is a way to see the size of a package(s) in terminal and Synaptic prior to downloading and installing it/them?



In the terminal, for a single package:



apt-cache --no-all-versions show $package | grep '^Size: '



for more than a package:



apt-cache --no-all-versions show $packages | 
awk '$1 == "Package:" { p = $2 }
$1 == "Size:" { printf("%10d %s\n", $2, p) }'


I have no idea about Synaptic.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...