Thursday, February 09, 2006

Size of Ubuntu Repository

When I tried to create local repository of Ubuntu, I was haunted by an unanswered question: How big will it be?
Googling and diving into gave me no solution.
Then, a friend in Ubuntu-id mailing list gave me the answer: calculate the size from every packages listed in Package.gz.

This is a sample (ugly) script I used to get main repository size calculated.

$ wget -O - |zcat|sed 's/Installed-Size://'|grep Size|awk '/Size:/ {pkgsize+=$2} END {print "package size = "pkgsize" Bytes"}'

The size of other repositories can be calculated by simply changing the path of Packages.gz


Brendon Kelly said...

That's a great script. It gave me just the answer I was looking for.

How did you create the local repository? (rsync or something else?)

Xlylith said...

I am using debmirror
I wrote about it in my previous post
The script is ugly though... but it works :-)