Setup Yum Server

Lets create a web based (http) yum repo.

Install apache, if it’s not already installed.

yum -y install httpd

Install createrepo

yum -y install createrepo

Create a webroot for the repository

mkdir /var/www/yum-repo

Put an RPM in the repo

cp /root/rpmbuild/RPMS/i386/motorrobot-0.77-0.i386.rpm /var/www/yum-repo/

Create the repo using createrepo

cd /var/www/yum-repo/ && createrepo

Alternatively, you can run the createrepo and generate a hash with the following, and also specify the path in the command so you don’t need to cd to the directory.

createrepo -v -s sha1 /var/www/yum-repo/

Create virtualhost for apache

echo "Alias /yum-repo /var/www/yum-repo" >> /etc/httpd/conf.d/yum-repo.conf

Now create the following repo file

vi /etc/yum.repos.d/motorrobot.repo

Paste the following in.

name=MotorRobot Repo      

We can now install the RPM we put in there earlier by typing

yum -y install motorrobot

Next we’ll want to add a GPG key for security.