Instsize - which packages are taking up the most space?

#!/usr/bin/env python
# Prints out packages installed on system
# ordered in descending order on size.
# Abhishek Dasgupta
import subprocess as S
import pickle, os
storage = '/home/username/.config/instsize'
def appendpkg(s): pkgsizes[s] = size(s)
def sgn(x):
if x == 0:
return 0
else:
return int(x/abs(x))
execo = lambda s: S.Popen(s.split(' '), stdout=S.PIPE).communicate()[0]
size = lambda s: float(filter(lambda s: s[:9] == 'Installed', execo('pacman -Qi '+s).split("\n"))\
[0][17:-2])
packages = execo('pacman -Qq').split("\n")[:-1]
def printpkg(p):
print "%-30s %.2f" % (p, pkgsizes[p])
if os.path.exists(storage):
p1 = open(storage, 'rb')
pkgsizes = pickle.load(p1)
p1.close()
else:
pkgsizes = {}
map(appendpkg, packages)
p1 = open(storage, 'wb')
pickle.dump(pkgsizes, p1)
packages.sort(cmp=lambda x,y: sgn(pkgsizes[x] - pkgsizes[y]), reverse=True)
map(printpkg, packages)
The script saves the installsizes to $HOME/.config/instsize so that later access is faster.
To force regeneration of the cache, just remove the $HOME/.config/instsize file.

nice little script
suggestion
you could determine username automatically:
username = os.getenv('USER')
storage = '/home/' + username + '/.config/instsize'

Similar Messages

  • How can i see which items are taking up the most disk space

    I have a Titanium PowerBook G4 with a 20GB hard drive. I'm currently using 15GB. I have tried searching through my hard drive to see which programs are taking up the most space. When I add up the totals of the various folders, etc., it's not 15GB worth. I feel like some items must be nested somehow, making them difficult to find. Is there some way to search your computer by size of items? I know that opening the hard drive and clicking on the size tab will sort things according to size. However, the folders don't show their size unless you click on them individually. Any suggestions?
    Thanks.

    While viewing a Finder window go to View>Show View Options, put a check in the box for 'Calculate All Sizes'. This is a setting you don't normally want to have turned on as it slows down the refresh when you switch windows, so you might want to remove the check once you identify the disk hogs.
    BTW- You can free up a lot of disk space & RAM if you remove any fonts that you & the OS don't really need. You may also have a great deal of space taken up by unnecessary printer drivers, not to mention the plethora of ReadMes & other 'goodies' that get added when you install software.
    HTH |:>)

  • My storage is going to be full very soon. The movie section is taking up the most space, does anybody know where those movies are?

    When I go into About this Mac and I look at my storage and the movie section is taking up the most space. Does anybody know where I can find those movies so I can deal with these movies taking up so much space. I would love how to know where to find them, can anybody help?

    Have you followed the advice in the previous posts?
    - check All My Files - Movies;
    - look in Music/iTunes/Movies;
    - look in your Movies folder;
    - use Omnidisksweeper to locate your largest files and folders;
    Matt

  • Finding out which songs/videos/apps use the most space

    Is there a way to see which songs/videos/apps are using the most space on the iPhone?
    I'd like to get a unified list of all files / directories, sorted by size -- the same thing you get by running
    the command
    du | sort -n
    on a unix directory tree.
    thanks,
    ilya

    The iPhone's file structure is not browsable in that way. You can check the file sizes in iTunes - for example, select a playlist that's synced to the iPhone and secondary-click in the column header area, then select the Size field and click on that field header twice to sort the playlist in descending size order.

  • How do i find out what is taking up the most space on my phone?

    I have the Iphone 4s and am having trouble syncing.  It keeps telling me i have gone over the space limit.  Is there a way to find out what is thaking up the most space?  there used to be a bar on the bottom of the screen that told you how much space audio took, pictures, extra space was avalible, etc. but i dont see anything like that now.

    Plug your device to your computer and open iTunes. There click on your device and it appears at the bottom how much space is each group of items usin (video, audio, music, photos, others...).
    Hope that helps.

  • Which packages are worth a recompile?

    I just discovered pacbuilder in 'Community Contributions' and now i am wondering which packages are worth a recompile to get some speed improvement.
    Up to now i only read of ffmpeg will work faster with sse3 enabled.
    What do you think?

    brebs wrote:Hence Gentoo is dying, especially since it has ridiculous political squabbling.
    This is so awesome: it really looks like an internal struggle in a corrupted democracy.
    kendosperling wrote:@brebs i know this. But never the less if there are any improvements why should i not try to use them. You already said most systems are idle a lot, this time could also be used to compile some packages in the background while surfing or reading your mail. I am sure there are some packages that will benefit.
    I believe that the benefit is so small that the time spent compiling fairly exceeds the time you save at every run, even if you run the program for several millennia.
    It's like with photovoltaic panels where the energy spent on building the panel itself exceeds the energy the panel will produce during its lifetime.
    It would be more efficient if you became a software developer or an engineer only to design a faster architecture to run the program on or develop a faster program, and then retire.
    Of course I'm exaggerating, but it's much more poetic this way.

  • Which packages are not required?

    Hi Friends,
    Initially, I was trying to install arch by just installing base and then going ahead, but was unable to get X. Then, I installed base+X11+X11 libs+ X11 something (dont remember..) and after a lot of trouble, finally got XFCE installed and running (though still problems with fontsand have posted another query in desktop environment section). I have noticed that in doing so, I have installed a lot of things that are not required for my system, like xf86-input-bla bla and xf86-vide-bla bla, I know that only a few of them are required, but i'm afraid of uninstalling anything given that could break the system.
    So, is there a way to determine which packages are being used by my system and which are required so that I can free up some space and make my box more slim.
    Please post your opinions. Thanks in advance.
    Ravi S Ghosh

    FUBAR wrote:
    [22:30:01|foo@bar:~] $ pacman -Q --help
    usage: pacman {-Q --query} [options] [package]
    options:
    -e, --orphans list all packages that were explicitly installed
    and are not required by any other packages
    o_O
    There are two notions of "orphan". As it is meant in the orphan script, a package is an orphan iff it is not needed in a working system. This is an intrinsically vague target, which can be focussed only through a partial heuristics.
    In the sense of the -Qe pacman option, an app is an orphan iff it is not a dependency of another package. In this sense, many vital apps -- explicitly installed -- in a system are orphans.
    However, it is true that pacman -Qe allows to have a list of the top-level apps (the stuff you know what it is, without the libraries etc.). If you identify in the list of pacman orphans the apps you do not need and then remove them with 'pacman -Rsc', you clean your system pretty well.
    However, you should be careful, many problems can be foreseen when you do not know what it is the package you are removing.

  • [SOLVED] Which packages are installed as dependencies when upgrading?

    Hello,
    When upgrading, I'd like to know which packages are upgraded and which ones are installed as new dependencies.
    How can I do that?
    The problem for me here is that I'd like to know which package is triggering an install of mariadb (which I don't need nor want).
    Thanks in advance!
    Last edited by lilorox (2014-04-30 07:14:03)

    mpan wrote:
    This will warn you about which package can't be installed because of mariadb not being installed
    pacman --your_usual_options --ignore mariadb
    Exactly what I needed
    This way I get the entire dependency tree so I know I can blame nepomuk-core.
    I knew the mariadb dependency came from KDE (baloo precisely) but I had no idea which package needed it.
    $ sudo pacman -Su --ignore mariadb --ignore mariadb-clients
    :: Starting full system upgrade...
    :: Replace shared-color-profiles with extra/colord? [Y/n]
    resolving dependencies...
    warning: ignoring package mariadb-5.5.36-1
    warning: ignoring package mariadb-clients-5.5.36-1
    warning: cannot resolve "mariadb-clients", a dependency of "percona-server"
    warning: cannot resolve "mariadb", a dependency of "akonadi"
    warning: cannot resolve "akonadi", a dependency of "kdepimlibs"
    warning: cannot resolve "kdepimlibs", a dependency of "baloo"
    warning: cannot resolve "baloo", a dependency of "nepomuk-core"
    :: The following package cannot be upgraded due to unresolvable dependencies:
    nepomuk-core
    :: Do you want to skip the above package for this upgrade? [y/N]

  • Which packages are required for make?

    I'd like to compile athcool and grabbed the source, but for the life of me, can't figure out which packages are needed for make.

    Thanks for the suggestion.  I got errors:
    # pacman -S base-devel
    base-devel package not found, searching for group...
    :: group base-devel (including ignored packages):
    diffutils ed gcc libtool m4 patch pkgconfig
    :: Install whole content? [Y/n] y
    :: group base-devel (including ignored packages):
    autoconf automake make
    :: Install whole content? [Y/n] y
    :: group base-devel (including ignored packages):
    autoconf automake bin86 bison ed fakeroot flex gcc libtool m4
    make patch pkgconfig
    :: Install whole content? [Y/n] y
    warning: diffutils-2.8.1-5 is up to date -- reinstalling
    warning: gcc-4.3.2-2 is up to date -- reinstalling
    warning: pkgconfig-0.23-1 is up to date -- reinstalling
    warning: automake-1.10.2-1 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    Targets (14): diffutils-2.8.1-5 ed-1.1-2 gcc-4.3.2-2 libtool-2.2.6a-1
    m4-1.4.12-1 patch-2.5.9-1 pkgconfig-0.23-1 autoconf-2.63-1
    automake-1.10.2-1 make-3.81-3 bin86-0.16.17-3 bison-2.4.1-1
    fakeroot-1.12.1-1 flex-2.5.35-1
    Total Download Size: 1.59 MB
    Total Installed Size: 78.50 MB
    Proceed with installation? [Y/n] y
    :: Retrieving packages from core-testing...
    diffutils-2.8.1-5-i686 191.5K 65.8K/s 00:00:03 [#####################] 100%
    ed-1.1-2-i686 45.7K 63.6K/s 00:00:01 [#####################] 100%
    libtool-2.2.6a-1-i686 578.7K 121.0K/s 00:00:05 [#####################] 100%
    patch-2.5.9-1-i686 54.3K 67.9K/s 00:00:01 [#####################] 100%
    pkgconfig-0.23-1-i686 49.9K 62.7K/s 00:00:01 [#####################] 100%
    :: Retrieving packages from core...
    bin86-0.16.17-3-i686 54.5K 210.0K/s 00:00:00 [#####################] 100%
    bison-2.4.1-1-i686 427.0K 52.3K/s 00:00:08 [#####################] 100%
    fakeroot-1.12.1-1-i686 52.7K 99.6K/s 00:00:01 [#####################] 100%
    flex-2.5.35-1-i686 176.0K 57.1K/s 00:00:03 [#####################] 100%
    checking package integrity...
    (14/14) checking for file conflicts [#####################] 100%
    error: could not prepare transaction
    error: failed to commit transaction (conflicting files)
    /usr/info/dir exists in both 'diffutils' and 'make'
    make: /usr/info/dir exists in filesystem
    Errors occurred, no packages were upgraded.
    Last edited by graysky (2009-02-17 01:44:04)

  • How do I upload to Facebook in High Resolution using my iPhone. Do I need an app? Which ones are best for the job? (I know how to do it on a PC :) )

    How do I upload photos to Facebook in High Resolution using my iPhone. Do I need an app? Which ones are best for the job? (I know how to do it on a PC )

    100pat wrote:
    Thanks, I can do it fine from my Windows desktop PC, I just want to know how to do it from an iPhone4
    Like I said before ask facebook or look at their support site to see if that is even a feature.

  • How can i determine which devices are used at the moment?

    Hi all,
    I am designing an interface with LabVIEW for uing agilent devices. My work colleagues will use this interface.  I want to determine which devices are used at the moment and if I determine used device, i will add automatically device names to interface's main vi. So all my work colleagues can see on the program which devices are used by another colleague. This devices are connected with GPIB. İ want to learn is there any function on Instrument I/O palette.
    Thanks,
    Omer
    Solved!
    Go to Solution.

    Hi Omer,
    so those devices are connected to the PC with a GPIB connection. Will your collegues run several DAQ programs at the same time?
    GPIB-devices being controlled by PC don't have a "in use"-signal. They wait for commands, execute them and send an answer. When you start to control them using two programs they may respond to both programs, mixing up settings/measurement values and so on.
    That being said: In MAX you can see all devices connected to your GPIB port. You could scan the GPIB port using VISA commands in your program. You might even try to access a certain device by it's VISA alias. I really don't know if you will get a "device nopt available" error message when that VISA alias is in use by a different program - but you might do a quick test on your own…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Can i choose which songs are added to the itunes match library?

    can i choose which songs are added to the itunes match library?

    Hi,
    No. It is all or nothing.
    Jim

  • HT4914 How can you tell which songs are downloaded from the cloud on an ipad

    How can you tell which songs are downloaded on the iPad from the cloud?

    I know ipad albums are more like tagging photos rather than putting them in folders. I just have a nagging feeling I missed some pics and I have too many to try to go figure out one by one. I don't look at my photos from the camera roll, only from albums I tagged just because I imported photos from different sources and the dates and order is really messed up. I just want to know that I am viewing all the photos from like this vacation or that event and there's none I missed that are only in the camera roll.

  • HT1386 The first time I synced my iphone with my mac, I didn't realize that all of my photos from iphoto would transfer over to the phone.   Now, I need to remove some, as they are taking up too much space.  I cannot figure out how to remove them from the

    The first time I synced my iphone 4 with my mac, I didn't realize that all of my photos from the iphoto library would transfer over to the phone (more than 3,000).   Now, I need to remove some, as they are taking up too much space.  I cannot figure out how to remove them from the phone.  I tried to uncheck boxes and sync again, but I get a message that there is no room on the iphone.  I've read as many articles as I can find, but still cannot manage this.  Thanks for any help.

    Open itunes, connect iphone, select what you want, sync

  • HT4623 how do i find out what is taking up the most stoarge on iphone 4?

    how do i find out what is taking up the most storage on iphone 4?

    Hi,
    Actually the real space it needs for download and upgrade it's a bit bigger, few more than 4Gb. Make sure you sync with iTunes so you don't loose anything. Moreover, you can safely delete any app because you can download it later on as it is linked to your Apple ID.
    Hope that helps.

Maybe you are looking for

  • How to calculate the Percent change in a dynamic

    hi All, I'm trying to get the percent increase/change of two dynamic colums.  In my report, the user has a checkbox where he can select two colums to calculate the percent growth. My DataSet is PilarName, Calification(is a decimal value) and Period (

  • Itunes has messed up my mediaplayer

    I started an Itunes playlist and my windows media player is now messed up

  • Power BI and Stored Procedures

    Hello, I am new to this forum and to Power BI Designer - please forgive me if this question has been asked. When I connect to my company's database through Power BI Designer, I can view the tables, UDFs and views.  The stored procedures, however, do

  • Is there any SAP module that manage the organization of trade shows/events?

    Hello everyone, I just wanted to know which module of SAP (if exists) can manage the organization of an event. For example, a beverage company which wants to invite its clients to a trade show, so it needs to plan and order all the equipment required

  • How do i sync my iphone 5 to my itunes for the first time

    I'm trying to sync my iphone 5 to my macbook and when I connect it, the only thing that happens is my phone charging and iPhoto popping up, but nothing in iTunes.