Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When using apt-get install <package_name>, 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?

share|improve this question

4 Answers 4

up vote 12 down vote accepted

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.

share|improve this answer

apt-cache show <package> or aptitude show <package> will show more information about a package, including size.

For the pacgage size only, you can use:

apt-cache show <package> | grep Installed-Size

or

aptitude show <package> | grep 'Uncompressed Size'

For .deb packages you can use:

dpkg-deb -I <package>.deb | grep Installed-Size
share|improve this answer
    
Will it show the size of the dependancies too? –  Tachyons Jul 29 '13 at 16:37
    
@Tachyons The question is: "Is there any way I can get the package size?". If you are interesed about dependencies size, you can use Ask Question button to ask another question. –  Radu Rădeanu Jul 29 '13 at 16:42
    
But including size of the dep's can made your answer efficient. just suggestion my friend,:) –  AgentCool Jul 29 '13 at 16:47
    
How about adding one more answer by using dpkg ? –  AgentCool Jul 29 '13 at 16:50
    
@Jai dpkg-deb -I <package>.deb | grep Installed-Size –  Radu Rădeanu Jul 29 '13 at 18:07

You could use the "dry run" mode, which just pretends to download and install packages

$ aptitude install -sy xlockmore
The following NEW packages will be installed:
  xlockmore 
0 packages upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
Need to get 194 kB of archives. After unpacking 373 kB will be used.
Would download/install/remove packages.
share|improve this answer
    
Tried but I don't see the size. The line: Need to get x of archives. After unpacking x will be used. doesn't show. –  user14590 Apr 19 '11 at 19:08
1  
Sorry, this should be aptitude not apt-get (I have a shell alias for that). Updated. This solution has the advantage of showing what you really need to download (doesn't count already installed dependencies). –  Adam Byrtek Apr 19 '11 at 21:20

You could try the below command to see the size of archieves that are needed to be downloaded for a particular package.

echo 'n' | sudo apt-get install package | awk '/^Need to get/ {print $4,$5}'

@enzotib answer is good but it show the size of the archives that are needed to be downloaded in some other format not in mb's. But this command will show the size in Mb's.

Example:

$ apt-cache --no-all-versions show chromium-browser | grep '^Size: '
Size: 41493718

$ echo 'n' | sudo apt-get install chromium-browser | awk '/^Need to get/ {print $4,$5}'
44.4 MB
share|improve this answer
    
post the reason for downvote. –  Avinash Raj Jun 6 at 3:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.