RHEL 5.x has groups. Yum command for CentOS is
. There should be a similar command in up2date.
Installing ALL of the packages is not something I would recommend, but I can think of few reasons you would like to do such a thing.
Simple script:
Code:
list=`ls -C -1 -R`
rm for_install.txt
echo $list > for_install.txt
cat for_install.txt | sort > sorted_install_list.txt
cat for_install.txt | cut -d " " -f1 | awk '{print $4 " " $1}' | sort | uniq > sortedlist.txt
cat sortedlist.txt | awk '/^[0-9]/ { print ""; printf $0} !/^[0-9]/ {printf $0} END {print ""}' > yumlist.txt
I haven't had the time to test it so there could be errors, but yumlist.txt should be long paragraph of filenames that can be inserted directly into yum/up2date command (like in the script below).
This is the "rpm-dephelper" program I created yesterday to help me recompile larger number of my(as in "no other repo has compiled them for CentOS/RHEL") src rpm's for x86_64 platform on the new, clean system (so far I used i386). I derived upper code from this baby:
Code:
#!/bin/bash
# rpm-dephelper
# Author: Ljubomir Ljubojevic <office a plnet.rs>
# 31.01.2010
list=""
list=`ls *src*.rpm`
for i in $list; do
rpmbuild --rebuild --nobuild -ba $i >& text.txt
cat text.txt | grep needed >> for_install.txt
done
cat for_install.txt | sort > sorted_install_list.txt
cat for_install.txt | cut -d " " -f1 | awk '{print $4 " " $1}' | sort | uniq > sortedlist.txt
cat sortedlist.txt | awk '/^[0-9]/ { print ""; printf $0} !/^[0-9]/ {printf $0} END {print ""}' > yumlist.txt
rm text.txt
yum install $(cat yumlist.txt)
And "rpm-rebuilder", to ease actual rebuild of src rpm's and of course to log all rebuilding attempts into log files to track down problems:
Code:
#!/bin/bash
# rpm-rebuilder
# Author: Ljubomir Ljubojevic <office a plnet.rs>
# 31.01.2010
list=`ls *src*.rpm`
for i in $list; do
rpmbuild --rebuild -ba $i 2>&1 | tee $i"_rebuild_log.txt"
done