LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-06-2011, 01:43 AM   #1
aggrishabh
Member
 
Registered: Nov 2010
Posts: 87

Rep: Reputation: 1
Question YUM on Cent OS


Hi All,

i am on CentOS 5.5.Can anyone share steps to creating local yum repository i did below steps but failed

First i copy whole all the dvd data to /var/ftp/pub/centos/
and create a .repo file in /etc/yum.repos.d/server.repo content is as follows

[root@Test ~]# cat /etc/yum.repos.d/Server.repo
[base]
name=CentOS-$releasever - Base
baseurl=file:///var/ftp/pub/centos/Centos/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
#gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates
#[update]
#name=CentOS-$releasever - Updates
#baseurl=http://192.168.*.*/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
#gpgcheck=1
#gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


[root@Test ~]# yum list
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
file:///var/ftp/pub/centos/Centos/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/var/ftp/pub/centos/Centos/repodata/repomd.xml'
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

Please let me know if anymore info is needed.
 
Old 04-06-2011, 02:33 AM   #2
sandy.bhadoriya
Member
 
Registered: Dec 2010
Posts: 31

Rep: Reputation: 3
yum -y --enablerepo=/var/ftp/pub/centos/Centos/


try this
 
Old 04-06-2011, 03:31 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
1) First i copy whole all the dvd data to /var/ftp/pub/centos/
2) ?
3) and create a .repo file in /etc/yum.repos.d/server.repo content is as follows
May be you missed step "2" : Command = 'createrepo <location>'
( Like 'createrepo /var/www/html/centos/4/os/i386/' )
http://www.howtoforge.com/creating_a...ository_centos
 
Old 04-06-2011, 10:28 PM   #4
aggrishabh
Member
 
Registered: Nov 2010
Posts: 87

Original Poster
Rep: Reputation: 1
i didn't
i tried commands below

1)createrepo /var/ftp/pub/centos/Centos
2)createrepo /var/ftp/pub/centos/
3)[root@Test CentOS]# cp /var/ftp/pub/centos/Centos/repodata/repomd.xml .
then fire command
createrepo -g /var/ftp/pub/centos/Centos .

but no luck


one thing here to ask is this a strict way to take hierarchy of directories as knudfl says.
because link of the tutorial suggested the below hierarchy.
( Like 'createrepo /var/www/html/centos/4/os/i386/' )

second thing is in the file /etc/yum.repos.d/CentOS-Base.repo(sample below)
where it get the value of $releasever and $basearch

[base]
name=CentOS-$releasever - Base
baseurl=http://192.168.*.*/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
 
Old 04-07-2011, 03:42 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
second thing is in the file /etc/yum.repos.d/CentOS-Base.repo(sample below)
where it get the value of $releasever and $basearch
Those are only used, when you don't have a fixed 'baseurl' like

baseurl=***********/var/www/html/centos/5/os/i386/
Or ..
baseurl=http://mirror.centos.org/centos/5.5/os/i386/
.....

The example in the linked HOWTO shows this
baseurl=http://192.168.*.*/centos/$releasever/os/$basearch/

... and the release etc. information is probably fetched from files in /etc/.
.

Last edited by knudfl; 04-07-2011 at 03:52 AM.
 
Old 04-07-2011, 07:45 AM   #6
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
Please see this link.

Remember, always try to google first before posting in LQ.

Also try to use codes. It makes post much readable.
 
Old 04-27-2011, 01:18 AM   #7
rkski
Member
 
Registered: Jan 2009
Location: Canada
Distribution: CentOS 6.3, Fedora 17
Posts: 247

Rep: Reputation: 51
Quote:
First i copy whole all the dvd data to /var/ftp/pub/centos/
Then run:

Code:
#cd /var/ftp/pub
#createrepo -v centos
 
  


Reply



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 install flash ... yum: command not found ... which yum ... /usr/bin/yum tg0000 Fedora 8 04-13-2011 11:25 AM
please tellme how to install yum in cent os 5 meandsushil Linux - Server 14 02-18-2010 06:32 PM
Weird things with gd and yum mysql on php compile 64 bit cent os 5 centosfan Linux - Server 2 09-16-2009 02:26 PM
Not Able To Login To Gnome session In Cent OS 5 after yum update rajesh.bahl Linux - General 5 12-02-2008 02:37 PM
Cent OS jolly1702 Linux - Newbie 3 08-24-2008 10:18 PM

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

All times are GMT -5. The time now is 07:36 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
Open Source Consulting | Domain Registration