You are not logged in.

#1 2009-10-04 20:28:09

SomeGuyDude
Member
Registered: 2008-10-09
Posts: 271

Anyone else periodically pacman -Q and "clean house"?

Every so often when I've gone through a period of installing/uninstalling 50 or 60 things, I notice my root partition is filling up, so I start going through and removing things.

For the uninitiated, that means uninstalling things and then running pacman -Rs $(pacman -Qqtd) to clear out unneeded dependencies.

Managed to get rid of about a gig and a half of crap. Felt good.


And in the midst of such perfection,
I can't help but feel diseased.

Offline

#2 2009-10-04 20:44:41

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: Anyone else periodically pacman -Q and "clean house"?

I avoid installing things I won't use often to begin with (or remove them when I am done).  Removing unneeded locales also freed up many megabytes of space.  The root partition is using only two and a half of the seven gigabytes allotted to it.

Last edited by Wintervenom (2009-10-04 20:45:07)

Offline

#3 2009-10-04 20:55:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Anyone else periodically pacman -Q and "clean house"?

On my EeePC I only have 4GB for / so I am both careful about what I install, but also regularly -Rs $(pacman -Qqtd). I also back everything up to an external drive and -Scc. Oddly, I also find this is extraordinarily satisfying...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2009-10-04 22:23:32

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Anyone else periodically pacman -Q and "clean house"?

I use to. Now I just pacman -Scc every few days in an effort to not repartition my primary hard drive.

Offline

#5 2009-10-05 12:35:31

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: Anyone else periodically pacman -Q and "clean house"?

Anyone else periodically pacman -Q and "clean house"?

My last resort of procrastination.

Offline

#6 2009-10-05 12:45:39

pocketcalc
Member
Registered: 2009-10-04
Posts: 3

Re: Anyone else periodically pacman -Q and "clean house"?

well, I've been running pacman -Scc after every package installation. I'm on a Asus Eee PC 700 (2G surf), with this very small 2G drive, and I'm already out of space. Right now, only 87MB free. I'm new to archlinx and would like to know how can I get a list of installed packages with the size of each package, so I can make room (with pacman -Rs) for at least VLC media player or a similar. I've already installed almost everything I need, I really just need some more free megas to reach the perfect system! Can anyone help me? Thanks.

Offline

#7 2009-10-05 13:02:32

Vintendo
Member
From: Netherlands
Registered: 2008-04-21
Posts: 375
Website

Re: Anyone else periodically pacman -Q and "clean house"?

I do a pacman -Qe and remove everything I don't need.

Offline

#8 2009-10-05 13:15:04

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Anyone else periodically pacman -Q and "clean house"?

pocketcalc wrote:

Right now, only 87MB free. I'm new to archlinx and would like to know how can I get a list of installed packages with the size of each package

Perhaps something like:

pacman -Qi  | awk 'BEGIN { FS=": " } /^Name/ { printf("%s: ", $2) } /^Installed Size/ {print $2}' | sort -n -t: -k2

Offline

#9 2009-10-05 13:56:03

pocketcalc
Member
Registered: 2009-10-04
Posts: 3

Re: Anyone else periodically pacman -Q and "clean house"?

chpln wrote:

Perhaps something like:

pacman -Qi  | awk 'BEGIN { FS=": " } /^Name/ { printf("%s: ", $2) } /^Installed Size/ {print $2}' | sort -n -t: -k2

Hi, Thanks for the trick, but nothing comes out of this command on my superuser prompt. I'm missing something? Does it write the output to a file, which I don't know?

Offline

#10 2009-10-05 14:10:00

takedown
Member
From: Argentina
Registered: 2008-08-31
Posts: 219

Re: Anyone else periodically pacman -Q and "clean house"?

SomeGuyDude wrote:

For the uninitiated, that means uninstalling things and then running pacman -Rs $(pacman -Qqtd) to clear out unneeded dependencies.

For me, pacman -Rs $(pacman -Qqtd) don't work.
This method give me wrong packages, for example:

bash$ pacman -Qqtd
automake                          
automoc4                          
bigreqsproto                      
cdrdao                            
cmake                             
cyrus-sasl                        
flex                              
git                               
glproto                           
gtk-qt-engine                     
kdemultimedia-kmix                
kdemultimedia-mplayerthumbs       
libcaptury                        
libidn                            
libmsn
libmtp
libnjb
libotr
libstdc++5
mercurial
netkit-bsd-finger
normalize
openslp
ortp
pkgconfig
postgresql
pyqt
qca-ossl
resourceproto
rpcbind
sox
speex
subversion
xcmiscproto
xf86driproto
xtrans

Much of this packages I really don't know if need it or no, but for example, I really need: cdrao (k3b), git, suversion and mercurial (some packages from aur need it), pyqt (I install it explicit, for programming), gtk-qt-engine (gtk under kde4 look n feel), kdemultimedia-kmix (I really need it).

It's a bug? It's a bad usage of pacman?

PD: sorry my poor english

Offline

#11 2009-10-05 14:23:08

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Anyone else periodically pacman -Q and "clean house"?

pocketcalc wrote:

Hi, Thanks for the trick, but nothing comes out of this command on my superuser prompt. I'm missing something? Does it write the output to a file, which I don't know?

This should be printed to standard output.  I can only guess the output from 'pacman -Qi' differs (a different field separator perhaps?).  Someone more familiar with pacman might be aware of an exact cause.

You may be able to modify this without too much difficulty by examining the output from pacman -Qi and adjusting the <>'d sections to suit:

[...]awk 'BEGIN { FS="<field separator>" } /^<Field1>/ { printf("%s: ", $2) } /^<Field2>/ {print $2}'[...]

Offline

#12 2009-10-05 14:46:27

steve___
Member
Registered: 2008-02-24
Posts: 454

Re: Anyone else periodically pacman -Q and "clean house"?

When i run 'pacman -Qqtd' I get:

bigreqsproto
db4.5
dirmngr
fluidsynth
git
glproto
gtk2-perl
imake
lcms
libelf
liblbxutil
libnotify
libraw1394
libsmbios
libxkbui
libxtrap
opencdk
pinentry
qt
ruby
sdl_image
taglib
termcap-compat
xorg-utils
xtrans
zvbi

I have vlc installed and know QT is a dependency.  Why is it in this
list?  As well uninstalling git and ruby is not what I want.

Offline

#13 2009-10-05 14:54:28

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: Anyone else periodically pacman -Q and "clean house"?

Try pacgraph. Running it from the command line will give you information about the size of each package and all its dependencies.

Offline

#14 2009-10-05 16:57:51

pocketcalc
Member
Registered: 2009-10-04
Posts: 3

Re: Anyone else periodically pacman -Q and "clean house"?

thanks, fijam. pacraph running from the command line really did the trick. I found that openoffice is taking too much space. I'm looking for a way to install only the writer, impress and calc components, or for a way to remove the math, draw and base components. but this is subject for another thread, I guess. thanks everyone.

Offline

#15 2009-10-05 22:16:39

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: Anyone else periodically pacman -Q and "clean house"?

Hi all,

This command is from the wiki here:

Pacman: ( It's about half-way down)
http://wiki.archlinux.org/index.php/Pacman

LANG=C pacman -Qi | sed -n '/^Name[^:]*: \(.*\)/{s//\1 /;x};/^Installed[^:]*: \(.*\)/{s//\1/;H;x;s/\n//;p}' | sort -nk2

as an alias for bashrc:

alias package_size="LANG=C pacman -Qi | sed -n '/^Name[^:]*: \(.*\)/{s//\1 /;x};/^Installed[^:]*: \(.*\)/{s//\1/;H;x;s/\n//;p}' | sort -nk2"

or

This is something I just whipped up that seems to work too. I actually forgot I had an alias for the above command while making this. Notice my command is close to the above but his/hers is more elegant in my opinion as it is almost pure sed.

pacman -Qi | egrep 'Name|Installed Size' | sed -n '/Name/{N; s/\n/ /; s/ Installed Size //;s/  *//p}' | sort -n -k3

In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

#16 2009-10-05 22:37:07

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: Anyone else periodically pacman -Q and "clean house"?

pocketcalc wrote:

thanks, fijam. pacraph running from the command line really did the trick. I found that openoffice is taking too much space. I'm looking for a way to install only the writer, impress and calc components, or for a way to remove the math, draw and base components. but this is subject for another thread, I guess. thanks everyone.

Also, as an alternative to OOo you could try Abiword (especially abiword-light from AUR) and Gnumeric. I personally would not try Arch on <4GB drive space, though.

Offline

#17 2009-10-06 02:09:19

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: Anyone else periodically pacman -Q and "clean house"?

I do a pacman -Sc periodically to clean all the uninstalled cache and a pacman -Qdt to check for unneeded dependencies to remove.

Offline

#18 2009-10-06 02:31:49

sHyLoCk
Member
From: /dev/null
Registered: 2009-06-19
Posts: 1,197

Re: Anyone else periodically pacman -Q and "clean house"?

I just backup all cache packages to external hard drive using my backup script along with important files like .xinitrc , grub.conf , pacman.conf,etc.


~ Regards,
sHy
ArchBang: Yet another Distro for Allan to break.
Blog | GIT | Forum (。◕‿◕。)

Offline

#19 2009-10-06 03:22:29

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Anyone else periodically pacman -Q and "clean house"?

du /var/cache/pacman/pkg -h
8.8G    /var/cache/pacman/pkg

I have plenty of space so I never clean out my pacman cache. It has saved me once or twice when I had to roll back a package because I was having issues. Once with cups and once with texlive.

Offline

#20 2009-10-06 19:02:47

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Anyone else periodically pacman -Q and "clean house"?

I'm using often localepurge, but something unneeded still remain.
I'd like some better filtering by something like pacman -Ql |grep $UNWANTED-LOCALES >> deleting_list.. On the other hand may be an idea to only include the necessary locales on the packages and saving a bunch of bandwidth wink
packaging on-demand? smile

F


do it good first, it will be faster than do it twice the saint wink

Offline

#21 2009-10-06 19:49:52

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: Anyone else periodically pacman -Q and "clean house"?

takedown wrote:
SomeGuyDude wrote:

For the uninitiated, that means uninstalling things and then running pacman -Rs $(pacman -Qqtd) to clear out unneeded dependencies.

For me, pacman -Rs $(pacman -Qqtd) don't work.
This method give me wrong packages, for example:

bash$ pacman -Qqtd
automake                          
automoc4                          
bigreqsproto                      
cdrdao                            
cmake                             
cyrus-sasl                        
flex                              
git                               
glproto                           
gtk-qt-engine                     
kdemultimedia-kmix                
kdemultimedia-mplayerthumbs       
libcaptury                        
libidn                            
libmsn
libmtp
libnjb
libotr
libstdc++5
mercurial
netkit-bsd-finger
normalize
openslp
ortp
pkgconfig
postgresql
pyqt
qca-ossl
resourceproto
rpcbind
sox
speex
subversion
xcmiscproto
xf86driproto
xtrans

Much of this packages I really don't know if need it or no, but for example, I really need: cdrao (k3b), git, suversion and mercurial (some packages from aur need it), pyqt (I install it explicit, for programming), gtk-qt-engine (gtk under kde4 look n feel), kdemultimedia-kmix (I really need it).

It's a bug? It's a bad usage of pacman?

PD: sorry my poor english

I used to think the same thing. 

-Qqtd returns packages that were installed as a *runtime* dependency for another package which is no longer installed.  i've never seen it report packages not satisfying these two conditions.

mercurial, subversion, automake... these are common *buildtime* dependencies.  they're often required by AUR packages which you build yourself... once built, you no longer need these packages and they are picked up by -Qqtd.  the more i use AUR, the less i can use that handy find-the-orphans one-liner effectively.

the other ones that you still think are mistakes, please use -Qi to check dependencies (i.e. k3b does not depend on cdrao) and to make sure things are listed as "explicitly installed" (i.e. pyqt).

if -Qi really contradicts -Qqdt, feel free to report a bug.

Offline

#22 2009-10-06 21:42:41

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: Anyone else periodically pacman -Q and "clean house"?

mikesd wrote:
du /var/cache/pacman/pkg -h
8.8G    /var/cache/pacman/pkg

I have plenty of space so I never clean out my pacman cache. It has saved me once or twice when I had to roll back a package because I was having issues. Once with cups and once with texlive.

I second that, I remember when I was first using arch I ran all the maintenance tasks that were listed in shaman and it slowed my download speed to a crawl, idk why this happened. I never really have to worry about space since I have a total of 1.2TB and my root partition is 20gb with 50gb of free space available to whatever on that disk

Offline

#23 2009-10-06 22:13:43

takedown
Member
From: Argentina
Registered: 2008-08-31
Posts: 219

Re: Anyone else periodically pacman -Q and "clean house"?

brisbin33 wrote:

I used to think the same thing. 

-Qqtd returns packages that were installed as a *runtime* dependency for another package which is no longer installed.  i've never seen it report packages not satisfying these two conditions.

mercurial, subversion, automake... these are common *buildtime* dependencies.  they're often required by AUR packages which you build yourself... once built, you no longer need these packages and they are picked up by -Qqtd.  the more i use AUR, the less i can use that handy find-the-orphans one-liner effectively.

the other ones that you still think are mistakes, please use -Qi to check dependencies (i.e. k3b does not depend on cdrao) and to make sure things are listed as "explicitly installed" (i.e. pyqt).

if -Qi really contradicts -Qqdt, feel free to report a bug.

Thanks brisbin33:
I'm trying to finish to understand your words and the mechanism by which it operates this command.
For example, i asked pacman for kdemultimedia-kmix, and It replied that was installed as a dependency, but no longer requires anyone.
The thing is I constantly using kmix, then to solve the issue I run:

pacman -Rsn kdemultimedia-kmix && pacman -S kdemultimedia-kmix

Now, pacman say that kmix is "explicitly installed".

I think maybe it's a way to clean my system.
I'll have to see what the **real** status of the other packages.

Thanks again brisbin

Offline

#24 2009-10-06 23:00:09

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: Anyone else periodically pacman -Q and "clean house"?

You don't have to delete and re-add packages to change the explicit/dep status. pacman has flags to do it for you, or you can hand-edit the desc file in the pacman DB - look at those files and you'll see the format is very simple.

Offline

#25 2009-10-07 00:15:59

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Anyone else periodically pacman -Q and "clean house"?

pocketcalc wrote:

thanks, fijam. pacraph running from the command line really did the trick. I found that openoffice is taking too much space. I'm looking for a way to install only the writer, impress and calc components, or for a way to remove the math, draw and base components. but this is subject for another thread, I guess. thanks everyone.

Hate to disappoint  you but it's openoffice as a whole that eats your space and not the separate functionality. They share a lot of codebase afaik. The split-out packages on distros that do use them are tiny, the core part quite big wink.

You're better off resizing your partitions or, if that's no option, trying another graphical environment. KDE and Gnome both pull in a lot of stuff, I have a lightweight system but still OOo on it because I want to handle MS documents as well as possible without having to install MS Office in Wine or in some virtual environment.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB