[CentOS] how to 'yum update' in a %post

JJ jj at thescottproject.com
Tue Jun 6 02:32:21 UTC 2006


I do our installs via PXE / HTTP, I go and get a post install script and run
it.  This way I don't have to muck around with the php scripts that generate
the kickstart files for the installs.



%post
mkdir -p /root/bin; cd /root/bin
wget -q
http://centos-4-repo1.XXX.XXX/yam/centos4-i386/install/post-install.sh
sh /root/bin/post-install.sh 2>&1 | tee >> /root/post-install.log 


Script on the kickstart server - post-install.sh


rm -rf /etc/yum/repos.d/*

cat >> /etc/yum.conf << "EOF"
[base]
name=CentOS-$releasever - Base
baseurl=http://centos-4-repo1.XXX.XXX/yam/centos4-i386/RPMS.os
        http://centos-4-repo2.XXX.XXX/yam/centos4-i386/RPMS.os
gpgcheck=0

[update]
name=CentOS-$releasever - Updates
baseurl=http://centos-4-repo1.XXX.XXX/yam/centos4-i386/RPMS.updates
        http://centos-4-repo2.XXX.XXX/yam/centos4-i386/RPMS.updates
gpgcheck=0
EOF

yum -y update



J.J.

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.1/355 - Release Date: 6/2/2006
 




More information about the CentOS mailing list