回覆列表
  • 1 # 使用者2150543099384

    #安裝所需軟體包

    1

    yum -y install createrepo mkisofs anaconda-runtime

    根據root下的install.log檔案,得到安裝的軟體包

    1

    awk "/Installing/{print $2}" install.log |sed "s/^[0-9]*://g" >/root/packages.list

    1

    2

    3

    4

    5

    [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

    複製軟體包

    1

    for fileRpm in `cat packages.list`; do cp -r /var/www/html/centOS6/Packages/$fileRpm* /var/www/html/centOS6.32bit/centOS6/Packages ; done

    按照執行就可以

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    [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]#

    1

    2

    3

    4

    5

    6

    [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 $? #測試上條命令是否執行成功

    按照執行就可以

    1

    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檔案位置

    1

    2

    3

    4

    5

    6

    7

    8

    [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]#

  • 中秋節和大豐收的關聯?
  • 新一輪國企改革將如何維護員工利益?