0

Right now we use Anaconda to create kickstart files. Everything works great but during the Centos install it throws an error that a package is missing. Our solution so far has been to mount disk 2 and hit retry. I want to fix this so that there is no need to mount disk 2 and we can do unattended installs. I setup a local YUM repo on our network with the common repos, base, extras, updates, percona...

I tried to use the repo directive in the ks file but it is still asking me for the second disk.

1

You haven't specified which version of CentOS you're using. The example below assumes Centos 6.7, using the netinstall ISO image to provide network connectivity (via DHCP) during the install. By installing over the network, it avoids the need to swap discs. It's not the only way around your problem, but it's easier than trying to rebuild the CentOS ISO images with local repos.

Here's some sample lines from our Kickstart configuration, which we use to hit a mix of local mirrors of the CentOS Base & Updates repositories, and our own custom repos:

url --url http://reposerver.intranet/repo/centos/6/os/x86_64/
repo --name=updates --baseurl=http://reposerver.intranet/repo/centos/6/updates/x86_64/
repo --name=custom-utils --baseurl=http://reposerver.intranet/repo/custom/
repo --name=vmware-tools --baseurl=http://reposerver.intranet/repo/vmware-tools

The "url" directive (more info) causes Anaconda to pull all base RPMs from the URL specified. The next line includes the updates repository, to catch any updated RPMs published since CentOS 6.7 was released. Finally the last two lines reference our own repos, containing some custom RPMs and the VMWare client RPMs.

In your %packages section, specify the packages you want installed. Anaconda will figure out the dependencies. Precede any you don't want with a dash. Include whole groups by prepending with @, eg @Base.

One thing you might want to do in the %post section of your Kickstart configuration is import the GPG keys for the packages in any custom repos you referenced earlier. GPG keys aren't checked during an Anaconda install, but will be once the system is built and running. This step facilitates updates to a system after installation. Here's how we do it:

%post
rpm --import http://reposerver.internal/repo/keys/RPM-GPG-KEY-CentOS-6
rpm --import http://reposerver.internal/repo/keys/RPM-GPG-KEY-custom
rpm --import http://reposerver.internal/repo/keys/RPM-GPG-KEY-rpmforge

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.