LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-10-2013, 09:40 PM   #1
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Rep: Reputation: Disabled
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.

Last edited by tewtechie25; 04-10-2013 at 09:42 PM. Reason: typo
 
Old 04-10-2013, 11:27 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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
 
1 members found this post helpful.
Old 04-11-2013, 12:56 AM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,229

Rep: Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522
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
 
Old 04-11-2013, 01:35 AM   #4
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Original Poster
Rep: Reputation: Disabled
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.. :-)

Last edited by tewtechie25; 04-11-2013 at 01:42 AM. Reason: add a line
 
Old 04-11-2013, 09:54 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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
 
Old 04-11-2013, 10:53 PM   #6
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-11-2013, 11:16 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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/
 
Old 04-12-2013, 01:48 AM   #8
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 525

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by tewtechie25 View Post
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

Last edited by mddnix; 04-12-2013 at 01:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yum Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. glowe Linux - Newbie 8 01-13-2016 11:55 PM
Help with YUM setup with local repository codenjanod Linux - Software 2 03-05-2010 04:09 AM
yum fails with error: Cannot retrieve repository metadata (repomd.xml) for repository dmendonsa Fedora 6 02-10-2010 08:23 PM
Setup YUM repository Mr.J Linux - Server 1 06-26-2008 11:04 AM
Redhat 5.1 Yum Repository vs Fedora x.x Yum Repository lead2gold Linux - Software 1 05-22-2008 03:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration