Setting up Offline Installation for Isolated Environment with Rocky Linux: Placing RPMs and Configuring Kickstart

For a task, I need to prepare an offline installation for an isolated environment. Therefore, I downloaded Rocky-9-3-x86_64-dvd.iso and prepared a custome kickstart file.
Now, I need to figure out where to place my newly created RPM. To give you an idea, the Rocky directory tree looks like this:
tree
.
├── AppStream
│ ├── Packages
│ │ ├── 3
│ │ │ ├── 389-ds-base-2.3.6-3.el9_3.x86_64.rpm
│ │ │ └── 389-ds-base-libs-2.3.6-3.el9_3.x86_64.rpm
│ │ ├── a
│ │ │ ├── a52dec-0.7.4-42.el9.x86_64.rpm

│ └── repodata
│ ├── 0e0e0252-80d4-47bf-bb11-1f97d7aac5b0-PRIMARY.xml.gz
│ ├── 216f3c4b35699fa9e71ccd4c7e0b7bb443a225af1ffbadda56883c5b553c83a5-primary.sqlite.gz
│ ├── 5a7d07744ad46174a9555561ec10ab9faf86c177bb149efb75e01d3b9eae3fb7-other.sqlite.gz
│ ├── a99be84840c72203bcce01e8ff632f8512569df3d2c48a94a5ae19ef66a05054-filelists.sqlite.gz
│ ├── d40daa02-667d-4b19-9e55-a79451f2edf7-FILELISTS.xml.gz
│ ├── d40daa02-667d-4b19-9e55-a79451f2edf7-GROUPS.xml
│ ├── d40daa02-667d-4b19-9e55-a79451f2edf7-GROUPS.xml.gz
│ ├── d40daa02-667d-4b19-9e55-a79451f2edf7-OTHER.xml.gz
│ ├── d9675e6d-d2b8-46d4-977f-de7f2e7fe6f1-UPDATEINFO.xml.gz
│ ├── repomd.xml
│ └── repomd.xml.asc
├── EFI
│ └── BOOT
│ ├── BOOTX64.EFI
│ ├── fonts
│ │ └── unicode.pf2
│ ├── grub.cfg
│ ├── grubx64.efi
│ └── mmx64.efi
├── images
│ ├── efiboot.img
│ ├── install.img
│ └── pxeboot
│ ├── initrd.img
│ └── vmlinuz
├── isolinux
│ ├── boot.cat
│ ├── boot.msg
│ ├── grub.conf
│ ├── initrd.img
│ ├── isolinux.bin
│ ├── isolinux.cfg
│ ├── ldlinux.c32
│ ├── libcom32.c32
│ ├── libutil.c32
│ ├── memtest
│ ├── splash.png
│ ├── vesamenu.c32
│ └── vmlinuz
├── LICENSE
└── media.repo

After placing my RPM, do I need to make modifications to any files? For the kickstart, is it enough to just put the package name under %package?

thank you for support

I would suggest having an entirely separate repo with your package in it, and in your kickstart you need to note the repo path. Don’t try to modify the repos (baseos, appstream).

. . .
repo --name="r_x86_64" --baseurl=http://10.100.0.1/r/custom/x86_64 --cost=300
. . .

%packages
. . .
custom-package-name

1 Like

thank you for replay,
I should do offline installation because the server will not have access to the internet, so I have to do it in offline mode.
I found this article otubo.net: Creating custom ISO images for Fedora, CentOS or RHEL, but rocky here I don’t know which folder I place my rpm

The guide suggests steps that I would suggest not to do. Leave BaseOS and AppStream alone and create a new repository.

My suggestion is to create a brand new directory, place your RPM into it, and run createrepo.

% mkdir custom_repo
% cp /path/to/rpm/custom-package-name custom_repo
% createrepo custom_repo

In the kickstart, you then need to point to the path.

repo --name="custom_repo" --baseurl=file:///run/install/repo/custom_repo

@packages
custom-package-name
2 Likes

thank you very much sir for the support, I trie to apply this method

last thing, could you give me an idea, I have some script files in bash and python which are quite many and I have to run them in %post, as they are many and very confusing to write them under %post, unfortunately I have to integrate them of my installation bootable USB folder of rocky linux and I have to call them and run them in %post