Wednesday, February 3, 2010

Free up space on rootfs

After enabling testing and dev I was running a bit low on free space on the root file system.  I started digging around and most is in /usr/bin and /usr/lib - but there was in fact about 30-40 MB of apt/dpkg related stuff in /var.  This part was quite easy to free with a few commands:

# mkdir -p /home/var/lib
# mv /var/lib/apt /home/var/lib && ln -s /home/var/lib/apt /var/lib
# mv /var/lib/dpkg /home/var/lib && ln -s /home/var/lib/dpkg /var/lib
# mkdir /home/var/cache
# mv /var/cache/apt /home/var/cache && ln -s /home/var/cache/apt /var/cache

That's about it - 30-40 MB freed on the root.

4 comments:

  1. after i freed up space >>my app manger stops working and now cant install any apps .
    the error:
    apt-worker:[some installed packages are broken]

    ReplyDelete
  2. problem solved :) i jus moved d files bak to original positions
    i jus needed the space to install nitdroid :)
    Thnaks .. helped a lot and saved me from reflashing ma device

    ReplyDelete
  3. I know this is an ancient blog entry but I couldn't resist commenting :)

    As of PR1.3, /var/cache/apt/archives is moved to /opt which is part of /home partition (now 2GB instead of fighting over spaces with rootfs). Though one can instead have all the downloaded deb files from apt-get for instance go to EMMC partition (29GB) or placed in the same directory as what hildon application manager uses (via red pill mode and unchecking clean apt cache) which is /home/user/MyDocs/.apt-archive-cache.

    To have whatever apt-get downloads be stored into /home/user/MyDocs/.apt-archive-cache, one needs to append this into their /etc/apt/apt.conf.d/00maemo: dir::cache::archives "/home/user/MyDocs/.apt-archive-cache";

    As for /var/lib/dpkg I've wrote up a nice little script to `optify' it. :)

    (edit) I can't paste the script here as it will exceed the number of words count. I'm going to blog it on my blog @ http://eidolon-sapphire.posterous.com/

    ReplyDelete