In you would like to rid the cruft on your system, or if you system has a virus (unlikely) or even if you want to install the system again at a later day a good way to do this is to package all your installed emerges. This can be done with a slightly-modified version of holla’s bash script:
# pkg-world
emerge -peq world | sed -n ‘s|^\[ebuild[^]]*\] \([^ $]\+\).*$|\1|p’ | \
sed -r ‘s/-[^-]+(-r[0-9]+)*$//’ | sort -u | while read pkg; do
for p in “${pkg}”; do
quickpkg –include-config=y –include-unmodified-config=y “$p”;
done;
done
Once this is done you can backup your Gentoo system by:
Obviously you might want to do more like /home and /root. Then you can extract the tar on a new stage3 and emerge -K --deep world. I’d recommend not trying this if too much time has passed between backup and reinstall as portage configurations may have changed, but otherwise it can save you alot of compiling time.
Please read the comments for other (easier) ways to do this.
the following should do the same as above script:
qlist -CISL | xargs quickpkg stuff
Ah, good thinking. That’s what I love about linux, people eventually find an easier way to do things.
quickpkg –include-config=y –include-unmodified-config=y $(eix -I –only-names)
Package names don’t contain whitespaces per ebuild naming standard.
Also, if you want to be on the safe side while not having to wait hours until your command completes you can just enable FEATURE=”buildpkg” and portage will do it for you when updating, push that to a backup server and next time your machine dies, restore will be über fast :)
Didn’t know about that buildpkg feature, pretty cool. Also told viewers to read the comments as these are clearly a better way to do this. Thanks for the tip.