LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   To setup a yum repository on Cent OS (https://www.linuxquestions.org/questions/linux-newbie-8/to-setup-a-yum-repository-on-cent-os-4175457742/)

tewtechie25 04-10-2013 08:40 PM

To setup a yum repository on Cent OS
 
Hi all,
I am new to Linux and this is my first post in the forum. I have practiced the yum commands like install, update, etc. Now I am trying to set up a yum repository on my CentOS 6.3 x86_64.
I am following the link:
http://www.harker.com/virtual/yumrepo.html

I created /var/www/html/centos/6/os/x86_64 and /var/www/html/centos/6/update/x86_64/

Copied the rpms to /var/www/html/centos/6/os/x86_64
Ran createrepo /var/www/html/centos/6/os/x86_64 and got the gz files created inside /var/www/html/centos/6/os/x86_64

The next step I am supposed to do is rsync. Different sites give different url for this command:
eg:

/usr/bin/rsync -iavrt rsync://mirrors.kernel.org/centos/5.2/updates/i386/
/var/www/html/centos/5.2/updates/i386/

/usr/bin/rsync -avrt rsync://ftp.riken.jp/centos/4/updates/i386 --exclude=debug/ /var/www/html/centos/4/updates/

What URL should I use for rsync?
Also, How to make sure that I am now using the local repository or Cent OS repository.
I typed #yum repolist but couldn't make out much from that.
Please pardon me if I had asked silly questions, but please do reply.

chrism01 04-10-2013 10:27 PM

Just follow that link, but use the correct versions ie 6.3 instead of 5.2 and x86_64 instead of i386.
You check the remote repo path etc here https://www.centos.org/modules/tinyc...ndex.php?id=32. Pick the nearest one ideally.

Here's a way to do it from your install media https://code.google.com/p/iredmail/w...Yum_Repository

John VV 04-10-2013 11:56 PM

Also be aware that 6.3 is not supported any longer
6.4 is the only 6 series that is supported

time to upgrade
Code:

su -
yum --releaseserver=6.4 upgrade


tewtechie25 04-11-2013 12:35 AM

Thanks a lot chrism01 and John VV.
It worked!!!!!

yum reposlist gave me below list
and I have a new entry for the local repository and the components in repolist is also more.

* base: mirror.nbrc.ac.in
* extras: mirror.nbrc.ac.in
* updates: mirror.nbrc.ac.in
repo id repo name status
MailRepo MyownMailRepo 3,887
base CentOS-6 - Base 6,381
extras CentOS-6 - Extras 12
updates CentOS-6 - Updates 467
repolist: 10,747



After that i did yum installed a component it got installed saying
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
zlib x86_64 1.2.3-29.el6 base 73 k


Does this mean it is still using the same base repository? I have copied every package to my local repository.
I have a very fundamental doubt also.. Even if I was NOT connected to internet, and while NOT having a local repository, I could still run the yum commands like reposlist, list etc (listed everything otherthan my local repository details which was setup later). How could that be possible ??
Thanking you againg for your valuable comments in last psots.. :-)

chrism01 04-11-2013 08:54 PM

The cmd attempts to list all the repos you got configured in /etc/yum.repos.d/. Whether or not you can reach those distros is a different qn ;)

tewtechie25 04-11-2013 09:53 PM

Oh.. Is it.. Later I installed components using yum install and it got installed.
But my double is how can make sure that it got installed from my new repository and not from the previous public repository.
Please help me out.

chrism01 04-11-2013 10:16 PM

Does it matter ? If both local and remote repos are for the correct version of the current system (and you should get errors if not) it likely doesn't.
You can check the exact version installed by
Code:

rpm -qa|grep -i <pkgname>
The main point is that remote repos will always be updated as new updates are issued.
Your local one will not unless you update it manually & frequently.. ;)

Local repos are usually only used by systems that cannot see the internet ; this leads to solns like Spacewalk/Satellite.
http://spacewalk.redhat.com/

Madhu Desai 04-12-2013 12:48 AM

Quote:

Originally Posted by tewtechie25 (Post 4930099)
But my double is how can make sure that it got installed from my new repository and not from the previous public repository.

Code:

# yum clean all
# rm -f /var/lib/rpm/__db*
# rpm --rebuilddb
# yum makecache



All times are GMT -5. The time now is 01:09 AM.