Le 26/02/2015 15:00, David Both a écrit : > Perhaps I have not been following closely enough, but why go backwards? > Why not start with a "minimal" installation and then add only those > packages that are needed for your situation? Here's why. I'm currently experimenting with CentOS on my workstation, trying out different desktop environments like GNOME3, KDE, MATE, Xfce. But at the same time, I'm also working on that same workstation, for example developing websites on a local LAMP stack, using multimedia apps like Audacity to edit some audio tracks for my training courses, etc. When switching from one desktop environment to another for the sake of trying it out, there's always tons of cruft on the system, even after a yum groupremove "Old Desktop Environment". And I don't want to do a fresh reinstallation, because I have all my data and files in place, and this is a RAID 1 installation, so it's not exactly trivial to reinstall and put everything back in place. Anyway, I spent a couple hours experimenting, and I found a satisfying solution. It's not very elegant, but it works. Here goes. 1. First, make a list of the packages contained in a minimal installation. This is easy, since I can do a minimal installation in a virtual guest, and then run the following little script: #!/bin/bash # # create_package_list.sh # # (c) Niki Kovacs, 2014 TMP=/tmp RPMLIST=$TMP/rpmlist.txt PKGLIST=$TMP/pkglist.txt rm -f $RPMLIST $PKGLIST rpm -qa | sort > $RPMLIST sed 's/-[^-]*-[^-]*\.[^.]*\.[^.]*$//' $RPMLIST > $PKGLIST 2. I copy that package list to the 'core' file in my Git repo and run the following script on the system I want to prune: #!/bin/bash # # purge_system.sh # # (c) Niki Kovacs, 2014 CWD=$(pwd) TMP=/tmp RPMLIST=$TMP/rpmlist.txt PKGLIST=$TMP/pkglist.txt PKGINFO=$TMP/pkg_database rpm -qa | sort > $RPMLIST sed 's/-[^-]*-[^-]*\.[^.]*\.[^.]*$//' $RPMLIST > $PKGLIST PACKAGES=$(egrep -v '(^\#)|(^\s+$)' $PKGLIST) rm -rf $RPMLIST $PKGLIST $PKGINFO mkdir $PKGINFO # Create core package database echo echo "+==================================" echo "| Creating core package database..." echo "+==================================" echo sleep 3 CORE=$(egrep -v '(^\#)|(^\s+$)' $CWD/../pkglists/core) for PACKAGE in $CORE; do printf "." touch $PKGINFO/$PACKAGE done unset CRUFT # Check installed packages against core package database echo echo echo "+========================================================" echo "| Checking for packages to be removed from your system..." echo "+========================================================" echo sleep 3 for PACKAGE in $PACKAGES; do if [ -r $PKGINFO/$PACKAGE ]; then continue else printf "." CRUFT="$CRUFT $PACKAGE" fi done echo echo # Remove all non-core packages yum remove $CRUFT I've tested this a few times, and it works as expected. I know my scripting style is a bit hodge-podge. If you have a more elegant solution, I'm always open for suggestions. Cheers, Niki -- Microlinux - Solutions informatiques 100% Linux et logiciels libres 7, place de l'église - 30730 Montpezat Web : http://www.microlinux.fr Mail : info at microlinux.fr Tél. : 04 66 63 10 32