How to setup yum repository in linux

setup repo:{Apache or some web server must be running, so that you should be able to see your files on browser}

go to the server where u want to set up repo: XXX.XXX.XXX.XXX
go to /var/www/html/
make a dir ‘XYZ’
put your new folder (having all files) in ‘XYZ’ folder, so you will see /var/www/html/XYZ/ur_build_dir
run create repo: createrepo -v /var/www/html/XYZ [this is for first time]
if you have already created repo then u need to update that with below command
createrepo –update /var/www/html/XYZ

so here repo creation is done:

now go to the box where u want to run yum(i.e. YYY.YYY.YYY.YYY)
go to /etc/yum.repos.d/
create your file xyz.repo [better to copy some existing one and change name]
now you have file /etc/yum.repos.d/xyz.repo
change baseurl section in xyz.repo file as ‘baseurl=http://XXX.XXX.XXX.XXX/XYZ’ [This path is same as you created for repo].

now run yum command from this box(i.e. YYY.YYY.YYY.YYY)
yum install abc* –nogpgcheck -y

[Yum install having lot of options so you can use as per your requirements]

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: