centos8 已經發布了GA版本,迫不及待的想嘗鮮了,然后現實總是那么殘酷,一直安裝失敗,具體安裝步驟如下:
假設cobbler已配置完成。
1、下載centos8 iso鏡像
wget http://mirrors.aliyun.com/centos/8.0.1905/isos/x86_64/CentOS-8-x86_64-1905-dvd1.iso
2、掛載
$ mount -o loop CentOS-8-x86_64-1905-dvd1.iso /mnt/
$ cd /mnt/
$ cp -r * /iso/centos8.0/
$ cd /iso/centos8.0/
AppStream BaseOS EFI images isolinux media.repo TRANS.TBL
3、配置kickstart文件
$ cat /var/lib/cobbler/kickstarts/centos8.0.ks #version=RHEL8 # System authorization information auth --enableshadow --passalgo=sha512 # System bootloader configuration bootloader --location=mbr --boot-drive=sda # Partition clearing information clearpart --all --initlabel # Use text mode install #text graphical # Firewall configuration firewall --disabled # Run the Setup Agent on first boot firstboot --disable ignoredisk --only-use=sda # System keyboard keyboard --vckeymap=us --xlayouts='us' # System language lang en_US.UTF-8 # Use network installation url --url=$tree # If any cobbler repo definitions were referenced in the kickstart profile, include them here. $yum_repo_stanza # Network information $SNIPPET('network_config') # Reboot after installation reboot #Root password rootpw --iscrypted $default_password_crypted # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # System timezone timezone --utc Asia/Shanghai # Install OS instead of upgrade install # Clear the Master Boot Record zerombr # Allow anaconda to partition the system as needed #autopart part /boot --fstype="xfs" --ondisk=sda --size=500 part swap --fstype="swap" --ondisk=sda --size=2048 part / --fstype="xfs" --ondisk=sda --size=1 --grow part biosboot --fstype="BIOS Boot" --ondisk=sda --size=2 %pre $SNIPPET('log_ks_pre') $SNIPPET('kickstart_start') $SNIPPET('pre_install_network_config') # Enable installation monitoring $SNIPPET('pre_anamon') %end %packages @^minimal-environment @standard %end
4、cobbler 導入
$ cobbler import --name=centos8.0 --path=/iso/centos8.0 --kickstart=/var/lib/cobbler/kickstarts/centos8.0.ks --arch=x86_64
發現報錯,報錯如下:
No signature matched
$ cobbler import --name=centos8.0 --path=/iso/centos8.0 --kickstart=/var/lib/cobbler/kickstarts/centos8.0.ks task started: 2019-10-16_074659_import task started (id=Media import, time=Wed Oct 16 07:46:59 2019) No signature matched in /var/www/cobbler/ks_mirror/centos8.0 !!! TASK FAILED !!!
解決:
$ cobbler signature update task started: 2019-10-16_074829_sigupdate task started (id=Updating Signatures, time=Wed Oct 16 07:48:29 2019) Successfully got file from https://cobbler.github.io/signatures/2.8.x/latest.json *** TASK COMPLETE ***
5、裝機
然后裝機過程中報錯了,截圖未報錯,報錯信息是:報錯的界面是配置"Installation Source",報錯為:"Error setting up base repository",反復測試依然有問題,不知道怎么設置,沒辦法,只能從iso那塊下手了,檢查iso文件內容。
6、iso配置
iso中有AppStream和BaseOS兩個目錄,目錄中都有Packages目錄和repodata目錄,將BaseOS中的 BaseOS/repodata/586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml 拷貝到 BaseOS 同級目錄下,並將 AppStream/Packages 下的auth*包文件全部拷貝到BaseOS/Packages 下,然后使用 createrepo -g 586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml . 創建repodata目錄。
$ cd /iso/centos8.0/ $ ls AppStream BaseOS EFI images isolinux media.repo TRANS.TBL $ cp AppStream/Packages/auth* BaseOS/Packages/ $ cp BaseOS/repodata/586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml ./ $ ls 586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml AppStream BaseOS EFI images isolinux media.repo TRANS.TBL $ createrepo -g 586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml . Spawning worker 0 with 167 pkgs Spawning worker 39 with 166 pkgs Workers Finished Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs complete $ rm -rf AppStream/repodata BaseOS/repodata
重新使用cobbler import,再使用最小化安裝。
當然我配置的可能哪里出了問題,導致出現了"Error setting up base repository"報錯,如果哪位大神解決了這個問題,歡迎評論區告知一聲。