You are not logged in.
Hi all, i finished rewriting archrefresh which is a tool to uninstall all your packages except those belonging to core and libfetch which is required by pacman to work.
The code can be found here and only works on python2 for now.
Run it as root:
#python2 archrefresh.py options
-v verbose mode
-h help message
As usual, comments, patches and constructive cricticism are welcome.
EDIT: replaced pacman2 for python2
Last edited by Duca (2012-07-18 06:05:45)
Offline
I probably read this wrong, but it only runs on pacman 2?
Offline
s/pacman2/python2/ ?
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
s/pacman2/python2/ ?
That makes a lot more sense
Offline
Wouldn't
# pacman -Rs $(comm -23 <(pacman -Qeq | sort) <((for i in $(pacman -Sl core | grep installed | cut -d ' ' -f 2); do pactree -ul $i; done) | sort -u | cut -d ' ' -f 1))
do the same?
It removes all explicitly installed packages and their dependencies but keeps the packages that are currently in the core repo and their dependencies.
I think.
Edit: libfetch is gone
Last edited by karol (2012-07-18 02:29:11)
Offline
Offline
I did try similar shorter ones, but I always get the same error
$ pacman -Qq | grep -vxFf <(pacman -Slq core) | pacman -R -
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: logrotate: requires cron
I use dcron :-)
Last edited by karol (2012-07-18 03:55:01)
Offline
I did try similar shorter ones, but I always get the same error
$ pacman -Qq | grep -vxFf <(pacman -Slq core) | pacman -R - checking dependencies... error: failed to prepare transaction (could not satisfy dependencies) :: logrotate: requires cron
I use dcron :-)
pacman -Qq | grep -vxFf <(pacman -Slq core) | pacman -Ru -
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Heh, seems I was lazy the wrong way and I should have thought for a second instead of just modifying a pacman tip from the wiki.
Offline
Thanks for pointing me to the pacman2 error.
Thanks also for the bash alternatives and i'll write them down. I experimented with one of them already but still felt like coding for learning reasons (and most of the work was reused from another project).
Offline
Ooh, were you influenced to write this by the ridiculous experience I recently wrote about on my blog?
If it is ever necessary to remove all packages except the base group, try this one liner:
The Arch Linux wiki entry doesn't instill the best of confidence...
Offline
Nice entry and it's funny we used the same word - refresh!
But no, my first time was someday back in 2011 before i made my first commit to bitbucket. I felt i ended up keeping more packages than i would feel comfortable with and started to code. At that time i didnt consider commenting out the other repos and wipe foreign packages as you did, perhaps if i have had the same idea as you i would have not coded anything at all.
I was working on a project which required to save as much space as i could (we had an upper limit and no extra work was needed to shrink further) and that tool helped me. I was still learning OOP and never issued commands from a program and parsed their results because most of my work was number crunching in fortran, so writing archrefresh seemed a nice idea.
Offline
Does it remove itself?
Offline
in some sense it does for it uninstalls python2
Offline