三、导入操作系统源
1 导入操作系统
这里提供三个范例,Ubuntu、CentOS和Fedora,实际上通过额外的设定,Unix和Windows也可以导入。
1.1 导入Ubuntu Server 12.04
光盘已自动挂载到了这个目录,/media/Ubuntu-Server\ 12.04\ LTS\ amd64/,可以通过cobbler import命令把光盘导入cobbler站点。
# cobbler import --path=/media/Ubuntu-Server\ 12.04\ LTS\ amd64/ --name=Ubuntu-Server-12.04 --arch=x86_64
task started: 2013-11-02_040257_import
task started (id=Media import, time=Sat Nov 2 04:02:57 2013)
Found a debian/ubuntu compatible signature: pool
adding distros
avoiding symlink loop
avoiding symlink loop
avoiding symlink loop
avoiding symlink loop
creating new distro: Ubuntu-Server-12.04-x86_64
creating new profile: Ubuntu-Server-12.04-x86_64
associating repos
traversing distro Ubuntu-Server-12.04-x86_64
descent into /var/www/cobbler/ks_mirror/Ubuntu-Server-12.04-x86_64
associating kickstarts
Found ubuntu release file: /var/www/cobbler/ks_mirror/Ubuntu-Server-12.04-x86_64/dists/precise/Release
skipping /var/www/cobbler/ks_mirror/Ubuntu-Server-12.04-x86_64/dists/unstable
skipping /var/www/cobbler/ks_mirror/Ubuntu-Server-12.04-x86_64/dists/stable
*** TASK COMPLETE ***
1. 2 导入CentOS 6.4
光盘已经挂载到/media/cdrom下。
注意,如果要导入CentOS系列的操作系统,需要事先安装createrepo,否则便会导入会失败。
# cobbler import --path=/media/cdrom/ --name=CentOS-6.4 --arch=x86_64
task started: 2013-11-02_040109_import
task started (id=Media import, time=Sat Nov 2 04:01:09 2013)
Found a redhat compatible signature: Packages
adding distros
creating new distro: CentOS-6.4-x86_64
creating new profile: CentOS-6.4-x86_64
associating repos
traversing distro CentOS-6.4-x86_64
descent into /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64
looking for /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/repodata/*comps*.xml
running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/repodata/2727fcb43fbe4c1a3588992af8c19e4d97167aee2f6088959221fc285cab6f72-c6-x86_64-comps.xml /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64
received on stdout:
received on stderr: /bin/sh: 1: createrepo: not found
associating kickstarts
*** TASK COMPLETE ***
安装createrepo工具
# apt-get install createrepo
继续导入
# cobbler import --path=/media/cdrom/ --name=CentOS-6.4 --arch=x86_64
task started: 2013-11-02_041443_import
task started (id=Media import, time=Sat Nov 2 04:14:43 2013)
Found a redhat compatible signature: Packages
adding distros
skipping import, as distro name already exists: CentOS-6.4-x86_64
associating repos
associating kickstarts
*** TASK COMPLETE ***
1.3 导入Fedora19
# mount Fedora-19-x86_64-DVD.iso /media/cdrom/
mount: block device /mnt/hgfs/OS-2/Fedora/V19/Fedora-19-x86_64-DVD.iso is write-protected, mounting read-only
root@localhost:/mnt/hgfs/OS-2/Fedora/V19# cobbler import --path=/media/cdrom/ --name=Fedora-19 --arch=x86_64
task started: 2013-11-02_042013_import
task started (id=Media import, time=Sat Nov 2 04:20:13 2013)
Found a redhat compatible signature: Packages
adding distros
creating new distro: Fedora-19-x86_64
creating new profile: Fedora-19-x86_64
associating repos
traversing distro Fedora-19-x86_64
descent into /var/www/cobbler/ks_mirror/Fedora-19-x86_64
processing repo at : /var/www/cobbler/ks_mirror/Fedora-19-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/Fedora-19-x86_64
looking for /var/www/cobbler/ks_mirror/Fedora-19-x86_64/repodata/*comps*.xml
running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/Fedora-19-x86_64/repodata/bf4e62e367e9b80e4f7c75092ef729f69d5d8e2d3eadd3c852ba6c5eb7a85353-Fedora-19-comps.xml /var/www/cobbler/ks_mirror/Fedora-19-x86_64
3949/3949 - Packages/i/ifuse-1.1.2-4.fc19.x86_64.rpm rpmpm.rpmm.fc19.x86_64.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
received on stderr: This option is deprecated
Error opening package - Packages/l/lensfun-0.2.7-1.fc19.x86_64.rpm
associating kickstarts
*** TASK COMPLETE ***