Kickstart using local repo from hard drive

Latest response

Hi,

Is there a way to configure kickstart to install a package from a local repo located within a secondary hard drive (sdb)? It seems like no more what I have tried, the install fails at the installation source with "Error setting up software source" when trying to point to the local repo within the secondary drive.

Example:

harddrive --partition=/dev/sdb --dir=/
ignoredisk --only-use=sda

repo --name="AppStream" --baseurl=file:///run/install/sources/mount-0001-hdd-iso/AppStream
repo --name="Epel" --baseurl=baseurl=file:///mnt/install/repo/epel

Thanks in advance!

Responses

The inst.addrepo= boot option mentioned here should allow you to specify a repository on a secondary hard drive, but that's separate from kickstart.

I've typically approached this by putting /images/install.img, along with all repositories, on the same secondary drive partition. Then, by specifying that partition in the inst.stage2= boot option, all repositories are available in the /mnt/install/repo directory during installation.

For example, if the repositories and /images/install.img are on a secondary partition with the label RHEL8_REPOS, then the boot options should contain the following.

inst.stage2=hd:LABEL=RHEL8_REPOS

See this earlier discussion for more detail: RHEL 8.4 installer won't use packages on bootable USB - Red Hat Customer Portal

Thanks for the reply! I tried the inst.addrepo=epel,hd:sdb:/ as well as the repo name=“EPEL” —dir=hd:sdb:/ but its failing on the software source. I also made sure I’m using harddrive and not cdrom.

I wonder if there’s any settings i might be missing that’s causing an issue…I feel like it since my iso and repos is all within the same directory it should ideally work with either inst.addrepo or using repo within the kickstart file.

Hmm my iso image and epel repo is within the same root directory but it does not seem to recognize my hd:sdb: drive for the epel repo. I’m passing the inst.stage2=hd:sdb:/ Is there anything else I would need in my kickstart file for it to recognize my epel repo?

Figured it out. The problem was the path…instead of /mnt/install/repo it should be /mnt/install/isodir. After making the path change I was able to direct kickstart to use my local repo on the secondary partition for my pre-installation pkgs.