Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Find out which packages use space in rootfs?

    Reply
    phedders | # 1 | 2010-02-25, 22:36 | Report

    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...

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by phedders; 2010-02-25 at 22:39.
    The Following 2 Users Say Thank You to phedders For This Useful Post:
    nbosch1, OranAgra

     
    OranAgra | # 2 | 2010-02-25, 22:43 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    b666m | # 3 | 2010-02-25, 22:44 | Report

    post it here:
    http://talk.maemo.org/showthread.php?t=39177&page=14


    Edit | Forward | Quote | Quick Reply | Thanks

     
    phedders | # 4 | 2010-02-25, 22:45 | Report

    Of course my obvious mistake is to be counting hardlinked files multiple times. ERM... That needs a tweak!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    phedders | # 5 | 2010-02-25, 22:46 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    phedders | # 6 | 2010-02-25, 23:21 | Report

    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....

    Edit | Forward | Quote | Quick Reply | Thanks

     
    phedders | # 7 | 2010-02-25, 23:50 | Report

    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"!

    Originally Posted by
    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to phedders For This Useful Post:
    Alan_Peery

     
    Rob1n | # 8 | 2010-02-26, 08:55 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

     
vBulletin® Version 3.8.8
Normal Logout