安装所需软件包
yum -y install createrepo mkisofs anaconda-runtime
根据root下的install.log文件,得到安装的软件包
awk '/Installing/{print $2}' install.log |sed 's/^[0-9]*://g' >/root/packages.list
[root@localhost www]# mkdir centOS6.32bit
[root@localhost html]# rsync -a --exclude=Packages centOS6 centOS6.32bit/
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# mkdir centOS6.32bit/Packages
复制软件包
for fileRpm in `cat packages.list`; do cp -r /var/www/html/centOS6/Packages/$fileRpm* /var/www/html/centOS6.32bit/centOS6/Packages ; done
按照执行就可以
[root@localhost centOS6]# cd /var/www/html/centOS6.32bit/centOS6
[root@localhost centOS6]# createrepo -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6
491/491 - Packages/abrt-addon-ccpp-2.0.8-6.el6.centos.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]# declare -x discinfo=`head -1 .discinfo`
[root@localhost centOS6]# createrepo -u "media://$discinfo" -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6/
488/488 - Packages/glibc-2.12-1.80.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]#
[root@localhost centOS6]# createrepo -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6/
488/488 - Packages/glibc-2.12-1.80.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]# echo $? #测试上条命令是否运行成功
按照执行就可以
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -o/home/CentOS-6.3-i386-bin-DVD1.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table /var/www/html/centOS6.32bit/centOS6
-o 输出iso文件位置
[root@localhost home]# /usr/bin/implantisomd5 CentOS-6.3-i386-bin-DVD1.iso
Inserting md5sum into iso image...
md5 = 219c7e289d01cdb84cf99de8b3e04503
Inserting fragment md5sums into iso image...
fragmd5 = a9265bee4498b5e93a2e84a58235458cad3651caa37f41da397155e6abe1
frags = 20
Setting supported flag to 0
[root@localhost home]#
可百度搜索关键字 centos 6 无人值守安装