Reply
Thread Tools
Posts: 155 | Thanked: 61 times | Joined on Nov 2009
#1
Want to see which packages are using the most space in your root filesystem?


Code:
for q in $(dpkg -l|grep ^.i|awk '{print $2}'); do x=0; for w in $(dpkg -L "$q"); do [ -f "$w" ] && df "$w"|grep -q " /$" && x=$(($x + $(du -x "$w" | awk '{print $1}') )); done; echo $x $q; done | tee packages
sort -n packages

I'm sure there are better ways but this way does not use any intermediary files...

Of course it would then be interesting to extract out the packges that are part of the firmware install...

I did a "DOH" when I saw:

90336 git-core

for example...

Last edited by phedders; 2010-02-25 at 22:39.
 

The Following 2 Users Say Thank You to phedders For This Useful Post:
OranAgra's Avatar
Posts: 33 | Thanked: 15 times | Joined on Oct 2009 @ Israel
#2
thanks.
i'm interested to know whitch applications / packedges came from extras-devel / extras-testing. since i don't remember what i took from where.
is that even possible?
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#3
 
Posts: 155 | Thanked: 61 times | Joined on Nov 2009
#4
Of course my obvious mistake is to be counting hardlinked files multiple times. ERM... That needs a tweak!
 
Posts: 155 | Thanked: 61 times | Joined on Nov 2009
#5
Originally Posted by OranAgra View Post
thanks.
i'm interested to know whitch applications / packedges came from extras-devel / extras-testing. since i don't remember what i took from where.
is that even possible?

Sure!

Code:
Nokia-N900-02-8:/home/opt/root# apt-cache policy git-core
git-core:
  Installed: 1:1.6.6-1maemo1
  Candidate: 1:1.6.6-1maemo1
  Version table:
 *** 1:1.6.6-1maemo1 0
        500 http://repository.maemo.org fremantle/free Packages
        100 /var/lib/dpkg/status
     1:1.6.6-1maemo0 0
        500 http://repository.maemo.org fremantle/free Packages
 
Posts: 155 | Thanked: 61 times | Joined on Nov 2009
#6
Ok - version two... now eliminates hard links - well counts just one:

Code:
#!/bin/sh

for q in $(dpkg -l|grep ^.i|awk '{print $2}'); do
  x=0
  for e in $( for w in $(dpkg -L "$q"); do [ -f "$w" ] && df "$w"|grep -q " /$" && stat -t "$w"; done | awk '{print $2, $8}'|sort -u|awk '{print $1}'); do
    x=$(($x + $e ))
  done
  echo $x $q
done
11602348 git-core

11mb is still a lot! Needs to get optified....
 
Posts: 155 | Thanked: 61 times | Joined on Nov 2009
#7
I just happened to have a dpkg -l from a fresh install (ie just firmware packages) and so to find the packages I've installed hogging root:

cat /opt/root/packages2 |while read a b; do grep -q $b /home/user/fresh.2010/dpkg-l || echo $a $b; done|sort -n

So heres my "hall of shame"!

407364 xournal
426263 libliqbase1
432631 libgcrypt11
502843 telepathy-salut
528114 libgnomecanvas2-common
536468 foreca-weather-applet
601220 libtheora0
684425 iproute
709576 gstreamer0.10-plugins-bad-extra
769560 libclutter-1.0-0
774209 bash
788259 libgnutls26
795956 gstreamer0.10-plugins-good-extra
822329 maemo-mapper
987553 libvorbisenc2
989273 openssh-client
1028890 python2.5-minimal
1200273 python2.5
1373208 wget
1388455 x11vnc
1487167 libpoppler2
1817061 midori
3386753 libgucharmap7
11602348 git-core
 

The Following User Says Thank You to phedders For This Useful Post:
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#8
Originally Posted by phedders View Post
Sure!

Code:
Nokia-N900-02-8:/home/opt/root# apt-cache policy git-core
git-core:
  Installed: 1:1.6.6-1maemo1
  Candidate: 1:1.6.6-1maemo1
  Version table:
 *** 1:1.6.6-1maemo1 0
        500 http://repository.maemo.org fremantle/free Packages
        100 /var/lib/dpkg/status
     1:1.6.6-1maemo0 0
        500 http://repository.maemo.org fremantle/free Packages
And how does that tell you whether it's from extras, extras-devel or extras-testing?
 
Reply


 
Forum Jump


All times are GMT. The time now is 00:52.