Wednesday, February 8, 2012

What are the size of Ubuntu and Debian repositories?

Before mirroring a complete Ubuntu / Debian repository on your hard drive, you want for sure have an estimation of the "weight" of all packages.

This script computes the total size of various Debian-based repositories by means of downloading the Packages.gz and making a sum of the size of every package. Of course, there are many shared packages between different versions of the same Linux distro. So this script will compute the max possible size.

Enjoy it!

I got the following results:..

Summary [Feb 9, 2012]

UBUNTU TOTAL SIZE = 466993 MB [456 GB] *

DEBIAN TOTAL SIZE = 184712 MB [180 GB] **
DEBIAN-SECURITY TOTAL SIZE = 22148 MB [21 GB] **
DEBIAN-VOLATILE TOTAL SIZE = 489 MB [0 GB]  **

TOTAL SIZE: ~658 GB

* Considering lucid, maverick, natty, oneiric and precise, with i386 and amd64 architectures, and the components main, multiverse, restricted and universe
** Considering  lenny and squeeze with i386, amd64, armel and arm architectures, and the components main, contrib and non-free

5 comments:

  1. Ubuntu Lucid up to 10.10 Maverick (March 2011) (total repository size 445GB, 515,975 Files) I downloaded it many times in order to make sure all of the files were there.

    ReplyDelete
    Replies
    1. Of course, you are probably right, the script doesn't consider the packages shared among the different versions (lucid, maverick, natty, oneiric and precise) and architectures (i386, amd64, etc). Hence the greater size, you can use it to compute the max possible size (an upper bound) without the need of a full download. I'll improve it later to considering such issue.

      Thanks for the feedback!.

      Delete
  2. This is great. Thanks.

    I made many changes to suit myself. Some things you might like to be aware of...

    You don't need this:

    sed 's/Installed-Size://'

    You can simply search for '^Size: ' to narrow down what you want.

    Also, I found using $(()) for calculations didn't work, so reverted to bc.

    Another interesting method I found to calculate the repo size of all the systems currently configures repositories is to use apt-cache show. Like so:

    echo $(apt-cache show '.*' | egrep '^Size: ' | cut -f2 -d' ' | tr '\n' '+' ; echo 0) | bc

    Thanks for the foundation.

    ReplyDelete