You are not logged in.
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
Online
Ok, thank you... :-)
digiKam developer - www.digikam.org
Offline
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
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
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
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