I know there is a previously asked question, but I still have some doubts so asking again.

How do I create a yum repo file?

I know that in the /etc/yum.repos.d/ I have to create .repo file. Below is the pattern:

1 [name ]

2 name=

3 baseurl=

4 enabled=1

5 gpgcheck=1

6 gpgkey=

Here in the baseurl which link should I give? I'm fully confused about this. How do I get that baseurl link? Can anyone please explain to me clearly?

I am using CentOS 6.2.


4 Answers 4


Found this here. Hope it helps.

The 'baseurl' line is the path that machine uses to get to the repository. If the machine has direct access to it or mounts it as a filesystem you can use a baseurl line like:

 baseurl = file:///srv/my/repo/

There are 3 slashes (/) following the file:, not 2. That is correct.

If you access the file via an http or https server you would use something like:

 baseurl = http://servername/my/repo

The baseurl is the location of the repository's files. You obtain this information from the provider of the repository.

Most repositories already provide a pre-configured .repo file which you can drop into /etc/yum.repos.d or a release.rpm which you can install which contains such a .repo file (this way is better since the repo can then keep itself updated).

  • ok now i want to install google-crome using yum. first i want create one repo file right? in that which beseurl link should i give?
    – max
    Jul 20, 2012 at 6:29

This is what i do

  1. I create the Folder call RPMS
  2. Then copy all the files from /Media/RHEL*/Server to /RPMS using cp * /RPMS when I'm in /Media/RHEL*/Server directory then it takes some minutes to copy all Rpms
  3. Then i create Repo for /RPMS
  4. After that i make a copy of /etc/yum.repos/rhel-source and name it rhel-local.repo
  5. Then vi rhel-local.repo and add following lines






Finally run yum clean all and yum list all

BASEURL is the absolute path to files

Hope this helps


You can create a file named google-chrome.repo with the following contents:

name=google-chrome - 64-bit

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.