You are not logged in.

#1 2009-04-11 08:11:00

TheGrudge
Member
Registered: 2006-06-15
Posts: 206
Website

Faster way to find old remaining files in the system?

Hi,

I'm one of the digiKam developers and I compile a lot of packages by myself. But I don't use a PKGBUILD for that because it slows me down a little bit (I need to change compile flags a lot for testing purposes).
Now I want to clean up my /usr dir, to find files that are not part of an installed package.

I can find those files with something like this:

find /usr -type f -print0 | xargs -0 pacman -Qo 2> nonepackagefiles.txt

but this is very slow (still faster then calling find with -exec, but still it takes hours).
Is there any faster way to find files that are not part of a package?


digiKam developer - www.digikam.org

Offline

#2 2009-04-11 08:12:29

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

Offline

#3 2009-04-11 08:24:04

TheGrudge
Member
Registered: 2006-06-15
Posts: 206
Website

Re: Faster way to find old remaining files in the system?

Ok, thank you... :-)


digiKam developer - www.digikam.org

Offline

#4 2009-04-11 08:27:10

bluewind
Administrator
From: Austria
Registered: 2008-07-13
Posts: 172
Website

Re: Faster way to find old remaining files in the system?

pacpal has such a feature and it's damn fast.
`pacpal --list-unpkgd /usr'

Last edited by bluewind (2009-04-11 08:27:57)

Offline

#5 2009-04-11 09:30:14

CaptainShanks
Member
Registered: 2008-10-25
Posts: 57

Re: Faster way to find old remaining files in the system?

bluewind wrote:

pacpal has such a feature and it's damn fast.
`pacpal --list-unpkgd /usr'

Um... How safe is it? I've been meaning to clean my /usr for awhile XD

Offline

#6 2009-04-11 09:46:23

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: Faster way to find old remaining files in the system?

CaptainShanks wrote:
bluewind wrote:

pacpal has such a feature and it's damn fast.
`pacpal --list-unpkgd /usr'

Um... How safe is it? I've been meaning to clean my /usr for awhile XD

What do you mean? The script just *lists files*, ie. prints some output on your screen.

EDIT: if you mean that if it's safe *deleting* all those listed files, then no, it's not safe. Make sure you know what are you deleting, ie that you know what was/is the purpose of that file. for instance, whatis databases, mime databases, various games' hiscore files, [*]tex formats, rubygems are all there, mostly created by the programs themselves or by their install scripts. Those are not to be deleted, unless you have a reason to delete them.

Last edited by bender02 (2009-04-11 10:02:10)

Offline

#7 2009-04-11 11:10:32

TheGrudge
Member
Registered: 2006-06-15
Posts: 206
Website

Re: Faster way to find old remaining files in the system?

I now cleaned up my /usr this way:

function oldfiles
{
    find $1 -type f | sort -u > filestolookfore
    pacman -Ql | cut -d ' ' -f2- | sort -u > pacfiles
    comm -23 filestolookfore pacfiles
    rm filestolookfore
    rm pacfiles
}

I made sure I don't need those "invalid" files and then removed them like this:

oldfiles /usr | xargs rm

Now X won't start due to the missing font cache. I have another alias that will reinstall all installed packages:

alias reinstall_packages='pacman -S $(pacman -Qq | grep -v "$(pacman -Qmq)")'

So after deleting everything, I reinstalled all my packages. This took me 10 minutes, inclusive a restart of the system.
After that, everything is fine again and even digiKam is faster now :-) , because old libs and plugins that are lying around in this folder for several years are now removed.

BUT ONLY DO THIS AFTER A BACKUP!!!! AND OF COURSE IF YOU KNOW YOU DON'T NEED ANY OF THE FILES IN /usr...!!!!


digiKam developer - www.digikam.org

Offline

Board footer

Powered by FluxBB