Re: [CentOS] Easy way to strip down CentOS?
On Fri, Feb 27, 2015 at 08:36:58AM +0100, Niki Kovacs wrote: Le 26/02/2015 15:53, David Both a écrit : Ok, I understand, now. I just leave multiple desktops in place and switch between them as I want. But perhaps you have reasons to do it as you do. That is one thing I really appreciate about Linux, the fact that there are many, many ways to accomplish almost everything and that what is right and works for me may not be what works best for you. I find that it's quite easy to get a minimal desktop going. I tend to use a custom compiled dwm, but this will work with most window managers. http://srobb.net/minimaldesktop.html -- Scott Robbins PGP keyID EB3467D6 ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 ) gpg --keyserver pgp.mit.edu --recv-keys EB3467D6 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
Le 26/02/2015 15:53, David Both a écrit : Ok, I understand, now. I just leave multiple desktops in place and switch between them as I want. But perhaps you have reasons to do it as you do. That is one thing I really appreciate about Linux, the fact that there are many, many ways to accomplish almost everything and that what is right and works for me may not be what works best for you. Your scripting style is irrelevant so long as it gets the job done for you. And one tenet the Unix/Linux Philosophy is, automate everything, which is what you have done. I've written a new blog post about the subject here: https://kikinovak.wordpress.com/2015/02/27/revenir-a-une-installation-minimale/ Cheers, Niki -- Microlinux - Solutions informatiques 100% Linux et logiciels libres 7, place de l'église - 30730 Montpezat Web : http://www.microlinux.fr Mail : i...@microlinux.fr Tél. : 04 66 63 10 32 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
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 : i...@microlinux.fr Tél. : 04 66 63 10 32 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
Ok, I understand, now. I just leave multiple desktops in place and switch between them as I want. But perhaps you have reasons to do it as you do. That is one thing I really appreciate about Linux, the fact that there are many, many ways to accomplish almost everything and that what is right and works for me may not be what works best for you. Your scripting style is irrelevant so long as it gets the job done for you. And one tenet the Unix/Linux Philosophy is, automate everything, which is what you have done. On 02/26/2015 09:21 AM, Niki Kovacs wrote: 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 -- * David P. Both, RHCE Millennium Technology Consulting LLC Raleigh, NC, USA 919-389-8678 db...@millennium-technology.com www.millennium-technology.com www.databook.bz - Home of the DataBook for Linux DataBook is a Registered Trademark of David Both * This communication may be unlawfully collected and stored by the National Security Agency (NSA) in secret. The parties to this email do not consent to the retrieving or storing of this communication and any related metadata, as well as printing, copying, re-transmitting, disseminating, or otherwise using it. If you believe you have received this communication in error, please delete it immediately. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
On Wed, February 25, 2015 14:18, Brian Mathis wrote: I don't think there's a single yum command that lets you roll back to the packages the were installed at a given point in time. I also don't think that this would get you back to the *exact* system as it was. # yum history rollback 1 # return to first post-update state. # yum history undo 1 # undo first update; return to initial state. -- *** E-Mail is NOT a SECURE channel *** James B. Byrnemailto:byrn...@harte-lyne.ca Harte Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
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? snip -- * David P. Both, RHCE Millennium Technology Consulting LLC Raleigh, NC, USA 919-389-8678 db...@millennium-technology.com www.millennium-technology.com www.databook.bz - Home of the DataBook for Linux DataBook is a Registered Trademark of David Both * This communication may be unlawfully collected and stored by the National Security Agency (NSA) in secret. The parties to this email do not consent to the retrieving or storing of this communication and any related metadata, as well as printing, copying, re-transmitting, disseminating, or otherwise using it. If you believe you have received this communication in error, please delete it immediately. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
Am 26.02.2015 um 08:38 schrieb James Hogarth james.hoga...@gmail.com: On Feb 25, 2015 10:00 PM, Peter pe...@pajamian.dhs.org wrote: I haven't tried this, but see if it works: yum shell remove * install @minimal run I've not tried this to see the effect but don't forget in el6 there is the yum history database... yum history list will show all yum operations that have happened on the system. In principle you could do yum history rollback 1 ... That wouldn't clear up config data of course. or # rpm -qa --last Lists the last installed package first. That way back would be one way to strip it down. I have here some minimal systems with about 200 packages installed ( rpm -qa | wc ). -- LF ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
Le 25/02/2015 23:00, Peter a écrit : I haven't tried this, but see if it works: yum shell remove * install @minimal run I get Package group minimal does not exist What now? -- Microlinux - Solutions informatiques 100% Linux et logiciels libres 7, place de l'église - 30730 Montpezat Web : http://www.microlinux.fr Mail : i...@microlinux.fr Tél. : 04 66 63 10 32 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
Le 26/02/2015 10:30, Leon Fauster a écrit : # rpm -qa --last Lists the last installed package first. That way back would be one way to strip it down. Here's a completely empiric approach, tried out on three different machines. It's not perfect, but it's already quite usable : https://kikinovak.wordpress.com/2015/02/26/elaguer-un-systeme-centos/ Cheers, Niki -- Microlinux - Solutions informatiques 100% Linux et logiciels libres 7, place de l'église - 30730 Montpezat Web : http://www.microlinux.fr Mail : i...@microlinux.fr Tél. : 04 66 63 10 32 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
The best way to do this is a new minimal install either in the GUI installer or with kickstart. And build up from there. If you do an install to e.g. CentOS-base.qcow2, that image already has machine-id and hostname set. While not running a VM, use guestfish to mount the qcow2, and make /etc/machine-id empty. Now, only use this base.qcow2 as a backing image. That is, never use it directly in a VM. Use qemu-img create -b base.qcow2 -f qcow2 guest1.qcow2 qemu-img create -b base.qcow2 -f qcow2 guest2.qcow2 qemu-img create -b base.qcow2 -f qcow2 guest3.qcow2 Now use the guestn.qcow2 in the VM. And at first boot, the machine-id will be populated. I'm not sure of any negative consequences of not doing this, but if you want to use remote journalling it's necessary so that the single journal can keep machines uniquely identified (even when changing the hostname). http://fedoraproject.org/wiki/Changes/Remote_Journal_Logging https://kashyapc.fedorapeople.org/virt/lc-2012/snapshots-handout.html Extra info: Anaconda uses this on lives to do installations (quite a few of these options are consolidated with -a): rsync -pogAXtlHrDx -- Chris Murphy ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
On Wed, Feb 25, 2015 at 2:04 PM, Niki Kovacs i...@microlinux.fr wrote: Le 25/02/2015 19:36, John R Pierce a écrit : I install from the 'minimum' ISO, and get that off the bat, then just install the packages I need with yum I do the same, but my question is: how to do that the other way around? Let's say you start from the base system, then install a couple dozen command-line utilities from cowsay to whois, then you install the X Window System group, a couple dozen fonts, then the WindowMaker window manager, then a handful of X applications... how do you manage from there to get back to exactly the base system you had from the start? I know this may sound a little academic, but it's for a little private experiment here. Niki It's not automatic so maybe not what you're looking for, but reviewing the yum log in /var/log/ will give you a chronological list of what packages were installed, so you could use that create a list of packages to remove. Be careful about updates that masquerade as installations, like kernel packages. You could also query by install date as outlined here: http://unix.stackexchange.com/questions/2291/centos-list-the-installed-rpms-by-date-of-installation-update I don't think there's a single yum command that lets you roll back to the packages the were installed at a given point in time. I also don't think that this would get you back to the *exact* system as it was. Linux packages aren't completely self contained like that, and have the potential to make other changes to the system, so it's not a completely clean rollback. At minimum, you'd have rpmsave files laying around, probably empty directories, etc... ❧ Brian Mathis @orev ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
On Wed, 25 Feb 2015 20:04:22 +0100 Niki Kovacs wrote: how do you manage from there to get back to exactly the base system you had from the start? My approach would be to create a list of installed rpms for what you're using as the base system: rpm -qa --qf %{NAME}\n | sort starting.txt Run that command again when you have all of the extra stuff installed, using a different filename for the output, for example, ending.txt Now merge and compare those files, and pull out the unique entries: sort starting.txt ending.txt | uniq -u newstuff.txt Now remove the files in newstuff.txt yum remove `cat newstuff.txt` There is probably a way to combine those last two steps into one single command. -- MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
On 2/25/2015 10:23 AM, Niki Kovacs wrote: I wonder if there's an easy way to strip down an installation to the bare minimum, e. g. the packages you get when you select minimum installation. I install from the 'minimum' ISO, and get that off the bat, then just install the packages I need with yum -- john r pierce 37N 122W somewhere on the middle of the left coast ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] Easy way to strip down CentOS?
Hi, I wonder if there's an easy way to strip down an installation to the bare minimum, e. g. the packages you get when you select minimum installation. In Slackware, the bone-headed package manager slackpkg has a few nice options, among which 'slackpkg clean-system', which removes all third-party packages in one single operation, or 'slackpkg remove package_group', which does exactly that. I know CentOS has yum groupinstall/groupremove etc. but as far as I can tell, if I only have a handful of packages from a package group installed, yum grouplist lists the group as not installed, so there's not an easy way to tell. You may wonder why I want to do this. I have CentOS installed on some sandbox machines here, and I like to fiddle with different desktops and setups just for the sake of experimenting. Cheers, Niki -- Microlinux - Solutions informatiques 100% Linux et logiciels libres 7, place de l'église - 30730 Montpezat Web : http://www.microlinux.fr Mail : i...@microlinux.fr Tél. : 04 66 63 10 32 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
Le 25/02/2015 19:36, John R Pierce a écrit : I install from the 'minimum' ISO, and get that off the bat, then just install the packages I need with yum I do the same, but my question is: how to do that the other way around? Let's say you start from the base system, then install a couple dozen command-line utilities from cowsay to whois, then you install the X Window System group, a couple dozen fonts, then the WindowMaker window manager, then a handful of X applications... how do you manage from there to get back to exactly the base system you had from the start? I know this may sound a little academic, but it's for a little private experiment here. Niki -- Microlinux - Solutions informatiques 100% Linux et logiciels libres 7, place de l'église - 30730 Montpezat Web : http://www.microlinux.fr Mail : i...@microlinux.fr Tél. : 04 66 63 10 32 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
Le 25/02/2015 20:18, Brian Mathis a écrit : I don't think there's a single yum command that lets you roll back to the packages the were installed at a given point in time. Maybe a good idea would be to find one or a handful of packages that the whole desktop and/or graphical subsystem depends on. Removing this one package - or this handful of packages, but which? - would already result in removing everything X11-related. After that, I can always manually sort out the remaining command-line stuff. Niki -- Microlinux - Solutions informatiques 100% Linux et logiciels libres 7, place de l'église - 30730 Montpezat Web : http://www.microlinux.fr Mail : i...@microlinux.fr Tél. : 04 66 63 10 32 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
On 2/25/2015 12:04 PM, Niki Kovacs wrote: Le 25/02/2015 19:36, John R Pierce a écrit : I install from the 'minimum' ISO, and get that off the bat, then just install the packages I need with yum I do the same, but my question is: how to do that the other way around? Let's say you start from the base system, then install a couple dozen command-line utilities from cowsay to whois, then you install the X Window System group, a couple dozen fonts, then the WindowMaker window manager, then a handful of X applications... how do you manage from there to get back to exactly the base system you had from the start? I know this may sound a little academic, but it's for a little private experiment here. Before I discovered the minimal iso I found that I could unselect everything and still get a working install with CentOS on my servers. Curiously, that didn't work with RedHat, had to at least select the base option and then go thru the base options to deselect bits. My experience is only up thru v6, don't know about v7 (refuse to use it for now). -- Steve ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
On 02/26/2015 07:23 AM, Niki Kovacs wrote: I wonder if there's an easy way to strip down an installation to the bare minimum, e. g. the packages you get when you select minimum installation. I haven't tried this, but see if it works: yum shell remove * install @minimal run Peter ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Easy way to strip down CentOS?
On Feb 25, 2015 10:00 PM, Peter pe...@pajamian.dhs.org wrote: I haven't tried this, but see if it works: yum shell remove * install @minimal run I've not tried this to see the effect but don't forget in el6 there is the yum history database... yum history list will show all yum operations that have happened on the system. In principle you could do yum history rollback 1 ... That wouldn't clear up config data of course. For testing stuff VM use and templates or snapshots are essential tools. Or create a bare minimal kick start ... Doesn't take long to do a fresh install to a clean system that way. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos