Something Different In Linux

Home » Basic Linux » create yum repository on local machine

If you want to install software/packages after installation of linux  (CentOS, Fedora etc.). You can create the yum repository to install all the software/packages which is present into the instillation CD. When you have try to install software/packages then some time it shows dependencies problems. To fix this problem I suggest your create the local machine yum repository by using the following steps.

1) Create directory

mkdir -p /root/install/RPMS

2) Copy all the software/packages RPMS from instillation CD/DVD to  /root/install/RPMS directory

3) Install createrepo RPM from /root/install/RPMS  directory using rpm command

rpm -ivh createrepo-0.4.11-3.el5.rpm

3) Now, we will have to create repo of the directory in which we have coied the RPMS. Following is the command to create the repo

[root@server ~] createrepo /root/install/RPMS

Once the above command gets completed you will find repodata directory in /root/install/RPMS folder

4) configuing YUM to work with local repository. Create a new file in /etc/yum.repo.d/ or open /etc/yum.conf and paste following

[local repo]
name = OS $release - MyLocalRepo
baseurl = file://root/install/RPMS

Now Try to install any package using ” yum ” command

for example:

yum install mysql

yum install php*


7 Responses so far.

  1. Chris says:

    On my system, the baseurl line required 3 slashes:

    baseurl = file:///root/install/RPMS

    Apparently two for the protocol + one for the root

  2. vinod says:

    working fine on server side but error downloading file at client
    error 14 ftp error 550

    please help me

  3. Thanks for the best comments

  4. bet365 says:

    hi!This was a really fabulous topic!
    I come from milan, I was luck to seek your topic in digg
    Also I get a lot in your website really thank your very much i will come later

  5. vishal joshi says:

    Thank you so much .
    I tried whole night and nothing worked. Thanks your solutions worked but there are some dependencies ..

  6. dilip says:

    I have two linux machines on one system. one acts as server and another as client. Its working on VMware with windows as base machine. my question is one of linux machine(client) have to query the server for downloading packages.
    How should i proceed

    • First you need to assign the IP address for server and client machine. If you are able to configure the yum repository on local machine (server) then configure the same yum repository on client machine but only change the base url to point to the server.


      Please refer the URL

      Or you can configure ftp on the server and use the IP address to download the packgaes on client machine.

      Rishikesh Vispute

Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...