[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: The size of debian packages



El Fri, Sep 26, 2003 at 12:15:49AM +0100, Bruce Stephens escribio:
> 
> This script shows installed packages together with their installed
> size:
> 
> #!/bin/sh
> gawk 'BEGIN {RS=""; FS="\n"}
>          $2~/ installed/ {
>                 split($1, pkg, " ");
>                 split($5, size, " ");
>                 print pkg[2], size[2];}' /var/lib/dpkg/status
> 
> I call it "installed".  Then things like "installed | sort -n -k 2 |
> less" can be useful.

I use this script, I call it "sz-dpkg". It shows the packages sorted by
size, and the total count at the end, so you can compare it with the
real value given by "df".

I don't use it that much after I discovered "deborphan".

---------------------------------------------------------------
#!/bin/bash
awk '

BEGIN {
	i=0;
	t=0;
}

/^Package:/ {
	p=$2;
	i=0;
}

/^Status:.* installed/ {
	i=1;
}

/Installed-Size:/ && (i==1) {
	s=$2;
	t=t+$2;
	print s "\t" p;
}

END {
	print t "\tTOTAL"
}
' /var/lib/dpkg/status | sort -n
---------------------------------------------------------------

    Daniel.



Reply to: