0
Hi friends today i'm gonna to say about, how to set up local repository in fedora to maintain and serve rpm package repository over http of ftp and to configure that on client machine to access this repository. Its useful in large organizations, college labs and foss labs etc. Because at the every time, if we have to install same package ( for example chrome browser have to install in all machines in foss lab ) in this case we just intall the browser by downloading the package from web. But think for every machine, if we  installed from web, then what will you think of the bandwidth usage of Internet connection? So to reduce bandwidth usage, we are gonna to create a local repository for all packages, which are all we want to install, on one machine. Then it will act as repository for other all client machines. Just follow the steps to setup local repository in fedora machines.


Step 1 : Create directory for local repository under /var/www/

Open Terminal and enter the following command in it.

mkdir -p /var/www/html/LocalRepo

Step 2 : Now download the rpm packages which are all want to install in machines.

Here i'm just taken chrome browser to install on all machines.

So, Download chrome browser  of rpm package at here...

Home Page : http://www.google.com/chrome

==> Chrome Browser for 64 bit

==> Chrome Browser for 32 bit

Step 3 : After downloaded rpm package for chrome browser, move your path from home folder to Downloads folder on your terminal by

cd Downloads

Step 4 : Copy the downloaded file to LocalRepo directory by

cp google*.rpm /var/www/html/LocalRepo

Step 5 : Here we are gonna to install createrepo. createrepo is a tool that is used to generate metadata of the software packages. To install createrepo

yum install createrepo

Step 6 : After installed createrepo tool, create repository of the directory using createrepo by

createrepo /var/www/html/LocalRepo

Step 7 : Once the create repository is finished check the repodata files under /var/www/html/LocalRepo directory.

Now you have to setup HTTP server to serve the content.

yum install httpd

Restart the service after installed httpd by

service httpd restart

That's all. You are successfully created local repository for your packages.

Step 8 : Go to client machine, which you want to install the software packages and configure YUM in client machine to work with created repository on main machine. So for this create a new file in /etc/yum.repo.d/ by

sudo gedit /etc/yum.repo.d/test.repo

Copy the below code and paste in to the test.repo file



[repo]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl=http://192.168.2.68/RPMS/  #give your server IP here
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

Save it and close it.



Step 9 : Now just try to install  packages using yum command. Here by our example, I'm just installing chrome browser



yum install google-chrome-stable


Enjoy !!!

If you have any queries, post it in comments.

Post a Comment

 
Top