0

I have a kickstart file I am trying to use for CentOS 7.4 installations. It works well, but it does not add the requested repos. I've run through this a few times and I'm sure it basically skips over the step for adding repos. Here is what it looks like:

url --url http://<my_IP>/centos71
lang en_US.UTF-8

keyboard us

timezone --utc America/New_York

network --onboot yes --device em1 --bootproto dhcp --noipv6

firewall --disabled
selinux --disabled
authconfig --enableshadow --passalgo=sha512

rootpw  --iscrypted <encrypted_pass>

clearpart --all --initlabel --drives=xvda

zerombr

part /boot --fstype=ext4 --asprimary --size=200 --ondisk=xvda
part pv.1 --asprimary --grow --size=10000 --ondisk=xvda
volgroup vg0 --pesize=4096 pv.1
logvol / --fstype=ext4 --name=lv_root --vgname=vg0 --size=9000
logvol swap --name=lv_swap --vgname=vg0 --size=512

bootloader --location=mbr --driveorder=xvda --append="crashkernel=auto"

reboot
repo --name="CentOS" --baseurl="http://mirror.centos.org/centos/7/os/x86_64/"
repo --name="DockerCE" --baseurl="https://download.docker.com/linux/centos/7/x86_64/stable/"

%packages
@base
@core
gcc
gcc-c++
git
net-snmp
nfs-utils
screen
vim
tree
yum-utils
device-mapper-persistent-data
lvm2
%end

....

When the installation completes, I check /etc/yum.repos.d/ and none of the repos are there. Is there something that I may be doing incorrectly?

2

The repo directive is only used for the installation step of anaconda installer. The repositories have to be configured during post-installation. That is, the repos you're specifying are configured for use during the installation step of the system, but not transferred over once the installation is complete.

Consider using a solution like Installing YUM repositories that are specified in Kickstart file.

In the post section of your kickstart include something like this:

%post
cat >/etc/yum.repos.d/your.repo <<EOF
[... INCLUDE REPO CONFIG FILE CONTENTS HERE ...]
EOF
2

You could try the --install flag, which should make your repos available post install, for example

repo --install --name="DockerCE" --baseurl="https://download.docker.com/linux/centos/7/x86_64/stable/"

Link to more documentation. Search for the section "repo".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.