CentOS8配置
yum install -y httpd && systemctl enable --now httpd
mkdir -pv /var/www/html/{7,ks}
#挂载CentOS7的光盘镜像
mount /dev/sr0 /var/www/html/7/
编写自动化应答文件
由于CentOS8上没有图形化的编写自动化应答文件了,在centos7上编写即可
[root@centos7 ~]#yum install -y system-config-kickstart
报错
如果有提示报错如下
file /usr/share/dbus-1/services/org.freedesktop.PackageKit.service from install of gnome-software-3.28.2-3.el7.x86_64 conflicts with file from package gnome-packagekit-3.14.3-5.el7.x86_64
解决:
[root@centos7 ~]#yum remove gnome-packagekit-3.14.3-5.el7.x86_64
[root@centos7 ~]#yum install -y system-config-kickstart
运行
软件是图形化的界面,在xshell中运行需要开启Xmanager - Passive
[root@centos7 ~]#export DISPLAY=10.0.0.1:0.0
[root@centos7 ~]#system-config-kickstart
按照提示一步一步配置就好了
报错
若报错仓库包找不到 解决: 打开yum的repo配置文件 将[Base] 更改为[development] 即可 配置完毕点击右上角的file 保存文件
生成的配置文件如下
[root@centos7 ~]#cat /root/centos7.cfg
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --plaintext 123456
# System language
lang en_US
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
firstboot --disable
# SELinux configuration
selinux --disabled
# Firewall configuration
firewall --disabled
# Network information
network --bootproto=dhcp --device=eth0
# Reboot after installation
reboot
# System timezone
timezone Africa/Abidjan
# Use network installation
url --url="http://10.0.0.5/7/"
# System bootloader configuration
bootloader --append="net.ifnames=0" --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part / --fstype="xfs" --size=10000
part /boot --fstype="xfs" --size=1000
part swap --fstype="swap" --size=2048
%post
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak
cat > /etc/yum.repos.d/base.repo <<EOF
[BaseOS]
[Base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=0
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
enabled=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=0
enabled=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=0
enabled=0
EOF
%end
%packages
@development
%end
复制配置文件到CentOS8
scp ks7.cfg 10.0.0.5:/var/www/html/ks/centos7.cfg
新建虚拟机
挂载网络安装的启动镜像CentOS-7-x86_64-NetInstall-2009.iso 开机启动在grub菜单界面按下esc 出现boot提示符 输入 linux ks=http://10.0.0.5/ks/centos7.cfg 回车即可
Loading…
|