LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 08-09-2007, 07:14 AM   #1
sefaklc
LQ Newbie
 
Registered: Aug 2007
Location: ankara(turkey)
Distribution: ubuntu,red hat
Posts: 28

Rep: Reputation: 15
createrepo: packages in local directory


hi all,
i want to create a repository. My .rpm files are in a local directory.
when i use :
Code:
 [root@localhost Desktop]# createrepo .
it creates folder named 'repodata'. and when i add a .repo file to '/etc/yum.repos.d' it works.when the directory which has .rpm files is read-only. i can't create 'repodata' folder to this directory. i tried -o command but i got error.
Code:
file:///home/sefa/Desktop/repo_2/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/home/sefa/Desktop/repo_2/repodata/repomd.xml'
Trying other mirror.
Error: Cannot open/read repomd.xml file for repository: localrepo_2
maybe i'm not using 'createrepo -o' correctly.
what can i do?

thanks a lot!
 
Old 08-09-2007, 10:26 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Provide the path info, let's say the rpm files are in /MyRepo directroy from this location type:

createrepo MyRepo

The yum repo file for you local repo in /etc/yum.repos.d/ directory will look something like;

[local-media]
name=Local-$releasever - Media
baseurl=file:///MyRepo
gpgcheck=0
enabled=1
 
Old 08-10-2007, 01:59 AM   #3
sefaklc
LQ Newbie
 
Registered: Aug 2007
Location: ankara(turkey)
Distribution: ubuntu,red hat
Posts: 28

Original Poster
Rep: Reputation: 15
thanks for your reply.
my rpm files are in /home/sefa/Desktop/repo_2 .when i run
Code:
 [root@localhost Desktop]# createrepo repo_2
i get 'Directory must exist ' error. but it works when i write the full path .(createrepo /home/sefa/Desktop/repo_2) .

But the real problem is when i run 'createrepo' it makes a new directory called 'repodata' inside /home/sefa/Desktop/repo_2. when repo_2 is read-only , it won't create 'repodata' inside repo_2.how can i solve this problem?
thanks.
 
Old 08-10-2007, 04:08 AM   #4
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Change the directory permissions to be read/write at least long enough to create the repodata subdirectory and files. Yes you need to supply the full path unless you are in the directory location where the rpm files for the repo reside.

A word of advice: Quit running as root, you do not have to be root to use createrepo or to do 99.99% of anything related to system management. Learn the power of su, sudo, wheel and groups.
 
Old 08-10-2007, 05:56 AM   #5
sefaklc
LQ Newbie
 
Registered: Aug 2007
Location: ankara(turkey)
Distribution: ubuntu,red hat
Posts: 28

Original Poster
Rep: Reputation: 15
thank you so much for replies.
but i want another solution, without changing permission.

i want to create repodata in another directory.Let you think i'm not root. and i can create repodata directory with
Code:
[sefa@localhost repo_2]$ createrepo -o /home/sefa/Desktop/ .
it creates repodata directory to another location.(to home/sefa/Desktop) but when i try to install a package , it gives me error.
my question may be stupid.but i think that if 'createrepo' give chance to create 'repodata' folder in another location, some method must exist to install packages in this situation.
 
Old 08-10-2007, 08:03 AM   #6
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Quote:
it creates repodata directory to another location.(to home/sefa/Desktop) but when i try to install a package , it gives me error.
And what exactly is this error???? Show the command and the error please.

This;
Quote:
createrepo -o /home/sefa/Desktop/ .
Should be something like;
createrepo -o /home/sefa/Desktop /the/full/path/to/the/RPMfiles

Last edited by Lenard; 08-10-2007 at 09:50 AM.
 
Old 08-13-2007, 05:50 AM   #7
sefaklc
LQ Newbie
 
Registered: Aug 2007
Location: ankara(turkey)
Distribution: ubuntu,red hat
Posts: 28

Original Poster
Rep: Reputation: 15
my rpms are in /home/sefa/Desktop/repo_2
i run this command:
Code:
 createrepo -o /home/sefa/Desktop /home/sefa/Desktop/repo_2
and repodata was created in /home/sefa/Desktop expectedly.
then when i run yum install package.rpm , it gives me:
Code:
file:///home/sefa/Desktop/repo_2/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/home/sefa/Desktop/repo_2/repodata/repomd.xml'
Trying other mirror.
Error: Cannot open/read repomd.xml file for repository: localrepo_2
it is searching repodata inside the folder which rpms hold.
in my config. file in /etc/repos.d
baseurl is /home/sefa/Desktop/repo_2.

i don't need this solution anymore.Maybe it would be useful to someone who encounters the same problem.
thank you.
 
Old 08-13-2007, 02:58 PM   #8
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Once again, please review the /etc/yum.repos.d/ local repo file, the format is for example;

[local-media]
name=Local-$releasever - Media
baseurl=file:///home/sefa/Desktop
gpgcheck=0
enabled=1

Last edited by Lenard; 08-13-2007 at 03:00 PM.
 
  


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
Keeping a local mirror of packages current KaYoS Slackware 14 10-23-2007 05:25 AM
can local packages be added to sources.list? wabbalee Linux - Software 9 02-01-2007 08:30 AM
createrepo linuxnewbie82 Fedora 1 07-23-2006 07:02 AM
Installing packages from local archives? Ravi72 Debian 2 09-13-2005 10:31 AM
APT setup for local packages rthomas_uk Debian 3 12-01-2004 08:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:23 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