You are not logged in.
Hi,
Here's a small script that sort the installed packages by decreasing installed size. It's useful to find unused packages that take lots of HD space when doing a system clean-up. I believe there was a similar script a couple or years ago in the forums but I couldn't find it so I made one. There might be better ways to do that (like getting the info straight from the local db instead of using pacman) but I didn't want to spend too much time on it.
#!/bin/bash
# Sort installed packages by decreasing installed size. Useful for system clean-up.
for package in $(pacman -Qq); do
echo $(pacman -Qi $package |grep 'Installed Size' |awk '{print $4 " " $5}') : $package
done |sort -g -r
EDIT: removed unecessary pipe to awk
Offline
you could use pacgraph it's even more suited, because it lists toplevel packages instead of also packages that are only dependencies
(but then again, you probably knew that already, being a dev/mod)
EDIT: you could use "pacman -Qq" instead of the piping into awk on the first line
Last edited by Heller_Barde (2009-08-15 21:24:15)
Offline
you could use pacgraph
it's even more suited, because it lists toplevel packages instead of also packages that are only dependencies
(but then again, you probably knew that already, being a dev/mod)
I wasn't aware of pacgraph. I don't visit much the forum anymore. It looks like a cool tool. But it seems to me that, for package cleanup, it is more convenient to have the packages listed in a single column than having to examine a figure. I'll probably give it a try next time I need to do some cleanup.
EDIT: you could use "pacman -Qq" instead of the piping into awk on the first line
Thanks. I did the change in the script. I never used the -q option before. That's why I didn't used it.
Offline
This does something similar to pacgraph but without the graph:
http://bbs.archlinux.org/viewtopic.php?id=73098
Offline
This does something similar to pacgraph but without the graph:
http://bbs.archlinux.org/viewtopic.php?id=73098
The name tells me something. That might be the script I had in mind but couldn't find.
Offline
You could still use Pacgraph. It has a "without the graph" mode, --console. Or just -c.
pacgraph --console
will generate the single column of stats you want.
Offline
+1 to pacgraph -c
Why reinvent the wheel?
When everything's coming your way, you're in the wrong lane I say.
FAQ / Beginners Guide / The Arch Way
Offline