首页 > 编程知识 正文

把系统做成iso文件,怎么封装linux系统教程

时间:2023-05-03 22:15:45 阅读:63212 作者:1508

将linux系统封装为iso文件

要基于/root/install.log文件定制iso文件,所有安装的linux系统都必须是rpm软件包安装。

一、创建linux iso文件

#安装所需的软件包

yum-yinstallcreaterepomkisofsanaconda-runtime

根据root下的install.log文件获取已安装的软件包

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

[ root @ localhost www ] # mkdir centos 6.32位

[ root @ localhost html ] # rsync-a-- exclude=packages centos6centos 6.32位/

[root@localhost html]# pwd

/var/www/html

[ root @ localhost html ] # mkdir centos 6.32位/包

复制软件包

for fileRpm in `cat packages.list `; OCP-r/var/www/html/centos6/packages/$ file rpm */var/www/html/centos 6.32位/centos6/packages; 道恩

听从执行就行了

[ root @ localhost centos6] # CD/var/www/html/centos 6.32位/centos 6

[ root @ localhost centos6] # createrepo-grep odata/*-comps.XML/var/www/html/centos 6.32位/centos 6

491/491-packages/abrt-addon-CCPP-2.0.8-6.el6.centos.i686.rpm

保存主元数据

saving文件列表元数据

Saving Other元数据

[ root @ localhost centos6] # declare-xdiscinfo=` head-1.discinfo `

[ root @ localhost centos6] # createrepo-u ' media ://$ discinfo '-grep odata/*-comps.XML/var/www/html /

488/488-packages/glibc-2.12-1.80.el6.i686.rpm

保存主元数据

saving文件列表元数据

Saving Other元数据

[root@localhost centOS6]#

[ root @ localhost centos6] # createrepo-grep odata/*-comps.XML/var/www/html/centos 6.32位/centos6/

488/488-packages/glibc-2.12-1.80.el6.i686.rpm

保存主元数据

saving文件列表元数据

Saving Other元数据

[root@localhost centOS6]# echo $? 测试上一个命令是否成功执行

听从执行就行了

miso fs-r-j-t-r-l-d-joliet-long-allow-multi dot-allow-leading-dots-no-bak-o/home/centos-6

-o输出iso文件的位置

[根@ localhost home ] #/usr /和谐苗条/implantisomd5 CentOS-6.3-i386-和谐苗条-DVD1.iso

inserting m D5 sumintoisop _ w _ picpath .

MD5=219 c 7e 289 d 01 c db84 cf 99d E8 B3 e 04503

insertingfragmentmd5sumsintoisop _ w _ picpath .

frag MD5=a 9265 bee 4498 b5 e 93 a 2e 84 a 58235458 CAD 3651 CAA 37 f 41 da 397155 e 6a be 1

frags=20

设置支持标志to 0

[root@localhost home]#

二、基于linux的iso镜像方法总结

将/dev/cdrom目录创建为镜像,并将其命名为/root/centos6.3.iso

方法1:ddif=/dev/cdrom of=/root/centos 6.3.iso

方法2 ) cat/dev/cdrom; /root/centos6.3.iso

方法3:mkisofs-r-o centos 6.3.iso/dev/cdrom

方法4:cp -r /home/user name.iso

创建iso镜像后,可以用linux上的DVD刻录,然后刻录到DVD光盘。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。