trying to set an automated kickstart install using the full iso dvd, on the post command i want to make sure the system is updated to latest versión of Rocky 8 but the command “yum update” or “dnf update” sends this output.
Unable to detect release version (use ‘–releasever’ to specify release version)
Error: There are no enabled repositories in “/etc/yum.repos.d”, “/etc/yum/repos.d”, “/etc/distro.repos.d”
The /etc has not got any of the files it says and don’t know how to add them. If i specify --releasever i only get the second line with the error.
Where are you running dnf update -y in your kickstart? All of my kickstarts have that command in %post and there has been no issues doing this (going as far back as the CentOS 5 and 6 days).
If you are removing the rocky-release/rocky-repos packages or replacing them with your own, or potentially modifying dnf in some manner with custom packages, this can easily cause your issue.
The error you are getting is about repositories. This tells me you are removing/replacing rocky-repos when you shouldn’t be.
repo would go at the top of a kickstart, where items like clearpart, text, and others exist. It should not be in any section (e.g. %post, %pre, %packages).
Assuming that you’re starting with the DVD image, you need the accompanying .treeinfo file and various image directories. Without them, url generally will not work as you expect it to.
# Download the ISO
% wget https://dl.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9-latest-x86_64-dvd.iso
# Mount
% mount -o loop Rocky-9-latest-x86_64-dvd.iso /mnt
# for my PXE setup, I copy the appropriate images
% mkdir /var/lib/tftpboot/rocky-9-x86_64
% cp /mnt/images/pxeboot/* /var/lib/tftpboot/rocky-9-x86_64
# Copy the entire ISO contents to the web directory
% mkdir -p /var/www/html/os/rocky/9/x86_64
% rsync -vrlptDSH --delete /mnt/ /var/www/html/os/rocky/9/x86_64
% umount /mnt
# treeinfo
% cat /var/www/html/os/rocky/9/x86_64/.treeinfo
[checksums]
images/efiboot.img = sha256:1d708b4ad14008293841b75eb8959cb65de2fd2f6c841046b797b5bbc78c3498
images/install.img = sha256:3616c7854ac7bc040936105d86f89a0d71504c104b2733ca65a1030f1f27bce1
images/pxeboot/initrd.img = sha256:b0c79d21b4d80aca65ae624ef467658adff112c334f7a27ae004884147da2704
images/pxeboot/vmlinuz = sha256:7fe2da512ffa4feb54e6dbeb26c2e0c0035ef897b5d5bada627da0a67f97419f
[general]
; WARNING.0 = This section provides compatibility with pre-productmd treeinfos.
; WARNING.1 = Read productmd documentation for details about new format.
arch = x86_64
family = Rocky Linux
name = Rocky Linux 9.3
packagedir = AppStream/Packages
platforms = x86_64,xen
repository = AppStream
timestamp = 1699824768
variant = AppStream
variants = AppStream,BaseOS
version = 9.3
[header]
type = productmd.treeinfo
version = 1.2
[images-x86_64]
efiboot.img = images/efiboot.img
initrd = images/pxeboot/initrd.img
kernel = images/pxeboot/vmlinuz
[images-xen]
initrd = images/pxeboot/initrd.img
kernel = images/pxeboot/vmlinuz
[media]
discnum = 1
totaldiscs = 1
[release]
name = Rocky Linux
short = Rocky
version = 9.3
[stage2]
mainimage = images/install.img
[tree]
arch = x86_64
build_timestamp = 1699824768
platforms = x86_64,xen
variants = AppStream,BaseOS
[variant-AppStream]
id = AppStream
name = AppStream
packages = AppStream/Packages
repository = AppStream
type = variant
uid = AppStream
[variant-BaseOS]
id = BaseOS
name = BaseOS
packages = BaseOS/Packages
repository = BaseOS
type = variant
uid = BaseOS