You are not logged in.

#1 2010-05-26 03:24:10

Japanlinux
Member
Registered: 2010-05-18
Posts: 173

Command Show biggest packages

Hello! I used ubuntu a while ago, and there was a command to show the packages in order of size. below is that command but limits it to show only the top 10 biggest packages.

dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}'

I have no idea how to search for that command on the forums...

Anyway, could someone kindly explain how I could use a command like this (hopefully simpler big_smile) on Arch?

Offline

#2 2010-05-26 03:53:19

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: Command Show biggest packages

A quick search for "largest packages" turned up this post by Daenyth:
http://bbs.archlinux.org/viewtopic.php?id=68400

I use Byte's script which is linked to at the bottom of the first page:
http://bbs.archlinux.org/viewtopic.php? … 65#p306065

Offline

#3 2010-05-26 04:21:06

hanlin
Member
Registered: 2010-05-14
Posts: 21

Re: Command Show biggest packages

Take a look at pacgraph

Offline

#4 2010-05-26 04:24:36

Japanlinux
Member
Registered: 2010-05-18
Posts: 173

Re: Command Show biggest packages

well, thank you. I did try 'Biggest packages,' which brought nothing useful, I couldn't figure out what to search for after that. Hadn't entered my mind to use a synonym roll oops... Thank you for not being too harsh on me.

Offline

#5 2010-05-26 04:33:31

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Command Show biggest packages

I just use ducks !!

The command is

 du -cks * | sort -rn | head -11

I have also created an alias called ducks for the above...and everytime I type in ducks...it shows me the hogs within that folder. Most times I am only concerned with the files in the home directory. The files in the other partitions (/ and or var) are most likely needed or I can clean var with pacman -Sc

Last edited by Inxsible (2010-05-26 04:34:58)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2010-05-26 04:34:02

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: Command Show biggest packages

Hi!

I think I managed to keep it shorter then the dpkg version.

perl -e '@i=`pacman -Qi`;for(@i){if(/Name\s+:(.+)/){$n=$1;}if(/Installed Size\s+:(.+) K/){$s=$1;}$w{$n}=$s;}for$f(sort{$w{$a}<=>$w{$b}}(keys(%w))){printf("\033[31m%8d\033[0mK %s\n",$w{$f},$f);}'

Or... maybe not. But prettier!

Offline

#7 2010-05-26 04:37:52

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: Command Show biggest packages

Offline

#8 2010-05-26 12:05:18

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Command Show biggest packages

Offline

#9 2010-05-26 12:57:56

Barghest
Member
From: Hanau/Germany
Registered: 2008-01-03
Posts: 563

Re: Command Show biggest packages

I want to add this from my .bashrc (it's from somewhere in this forum)

function biggestProgs()
{
    echo "-----+---------+---------------------------"
    echo " POS | SIZE MB |            NAME " 
    echo "-----+---------+---------------------------"
    pacman -Qs|awk '/local/{print substr($3,2)" "substr($1,7)}'|sort -rn|head -$1|awk '{printf "%4d | %7s | %s\n",NR,$1,$2}'
}

Offline

#10 2010-05-26 18:50:05

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: Command Show biggest packages

Also there is, for the GUI part, pacstats (it's in AUR)

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#11 2010-05-26 21:28:11

juster
Forum Fellow
Registered: 2008-10-07
Posts: 195

Re: Command Show biggest packages

Here is a command to get basically the same output as your original ubuntu command gives:

pacman -Qi | awk '/Name/ { name=$3 } /Size/ { printf "%.3fMB\t%s\n", $4/1024, name }' | sort -rh | head -n 10

Offline

#12 2010-05-26 22:25:38

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: Command Show biggest packages

hanlin wrote:

Take a look at pacgraph

That is an amazing package! Thanks big_smile

Offline

#13 2010-05-27 14:31:19

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Re: Command Show biggest packages

I just came up with this tongue :

for file in /var/lib/pacman/local/*; do echo "$(sed -n '/^%SIZE%$/{N;s/.*\n//p}' < $file/desc) ${file##*/}"; done | sort -n

Last edited by TaylanUB (2010-05-27 14:31:39)


``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein

Offline

Board footer

Powered by FluxBB