LinuxQuestions.org
Latest LQ Deal: Linux Power User 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 05-23-2013, 05:30 PM   #1
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Rep: Reputation: Disabled
Yum repository on Ubuntu possible ?


Hi Friends,
I have successfully created Yum repository over RHEL6 previously using the link
https://code.google.com/p/iredmail/w...Yum_Repository . Now I am assigned a task is to create yum repository on Ubuntu12. I understand Ubuntu uses apt-get instead of yum. So is it possible to setup yum repository on Ubuntu with similar steps or I have to set up an apt-get repository?
I didn't get any good material on search.. Kindly answer me..
 
Old 05-23-2013, 05:40 PM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Hey there,

First off, welcome here!!!
Secondly...why use the Yum anyway? The 'buntu sisters have a solid (maybe even broader?) package base...do you have a solid reason to do so?
Do realise that the Yum repo holds Fedora/RHel/CentOS centric packages that are optimised for that platform. Deviating from the repo could lead to unexpected results...

Thor
 
Old 05-23-2013, 05:55 PM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Yes, of course you can. But what's the point? Who assigned you this "task," and why do they want it done?
 
Old 05-23-2013, 06:00 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852
Sure, create the repo following the instructions, copy it over to an Ubuntu machine, setup a webserver or ftp-server that serves the repository and adapt the baseurl to point to the Ubuntu machine in the repo file. In the end a repo server is nothing else than a machine serving files, you could even do that with Windows.
 
Old 05-23-2013, 06:07 PM   #5
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thanks for the replies.. :-)
My requirement is like this: We got an Ubuntu server, where I need to setup a yum/apt-get repository and store a bulk of rpm packages in it. The Redhat client machines should be able to install rpm packages from that Ubuntu repository. But I get confused because rpms use yum and if I store packages in an ubuntu server(where apt-get is more appropriate) will cause conflict. This is the reason I was thinking about a yum on Ubuntu.

Please reply.

Last edited by tewtechie25; 05-23-2013 at 06:09 PM.
 
Old 05-23-2013, 06:18 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,552

Rep: Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112
An RPM file is just a file. Ubuntu doesn't care that it's hosting a bunch of RPM files any more than if it were hosting a bunch of images or movies or other data files.

Of course you wouldn't want to USE those RPMs on the Ubuntu server, but it sounds like it'll just be hosting them for your RH machines to pull from, in which case just set up the repo like you would on any other distro.
 
Old 05-23-2013, 06:22 PM   #7
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Original Poster
Rep: Reputation: Disabled
createrepo is the rpm which helped me create a yum repository in RHEL.
To create yum repository on Ubuntu, I will not be able to install that rpm in Ubuntu, right?
What other way can I use to set up yum repository and get the gz files created in my repository?

I followed this link to setup yum repo on RHEL.
https://code.google.com/p/iredmail/w...Yum_Repository

Last edited by tewtechie25; 05-23-2013 at 06:32 PM.
 
Old 05-23-2013, 07:40 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852
Ubuntu has the createrepo package in its repositories, just install it and use it as you would do on a RHEL machine.
http://packages.ubuntu.com/precise/createrepo
 
Old 05-23-2013, 07:52 PM   #9
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thanks for the reply...

Please help me understand one fundamental point here..
Wherever, I have seen steps to setup yum repo on RHEL, I have seen the createrepo rpm to be installed, which creates the metadata.
Since I had used the same computer as both client and server, I was under the impression that
1. createrepo rpm installation(metadata creation) has to be done at server end, with in repository folder. (I assume, it should be always at server end).
2. I have also updated the /etc/yum.repos.d/XXX.repo with baseurl pointing to the repoditory folder. (I assume it should be updated only client end).
Since I had used the same computer as both client and server for testing, it worked for me.

Please correct my 2 assumptions and let me know if metadata is needed at client end also, if using seperate client and server machines.

Last edited by tewtechie25; 05-23-2013 at 07:54 PM.
 
Old 05-23-2013, 07:55 PM   #10
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Well, yes, that repo creation prescription wants you to execute a program, createrepo, installed from a YUM repo. So, see if you can install it using the Ubuntu "rpm" package, or the "alien" package. (You will need to download the createrepo rpm package "by hand," but that's not too hard to do.) You might find this post helpful.

Last edited by PTrenholme; 05-23-2013 at 08:00 PM. Reason: Confused phrasing corrected.
 
Old 05-23-2013, 08:14 PM   #11
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Original Poster
Rep: Reputation: Disabled
PTrenholme: I have used exactly the same URL that you have provided for RHEL.

Everyone: So that means there is no need of metadata to be present in client machine?
Only the /etc/yum.repos.d/XXX.repo at client should be made to point to Yum server, right ?

Thanks TobiSGD... I will uncompress the createrepo_0.4.11.orig.tar.gz file in the repo folder.
Then do
./configure
make
make install (Please spare, I am new to this)

I believe this will give me the metadata in the Ubundu repository.
 
Old 05-23-2013, 08:19 PM   #12
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852
Quote:
Originally Posted by PTrenholme View Post
Well, yes, that repo creation prescription wants you to execute a program, createrepo, installed from a YUM repo. So, see if you can install it using the Ubuntu "rpm" package, or the "alien" package. (You will need to download the createrepo rpm package "by hand," but that's not too hard to do.) You might find this post helpful.
Again, createrepo is available in the Ubuntu repositories, a simple
Code:
sudo apt-get install createrepo
will install it, you don't need rpm or alien for it.

Quote:
Originally Posted by tewtechie25
1. createrepo rpm installation(metadata creation) has to be done at server end, with in repository folder. (I assume, it should be always at server end).
Exactly, this is done on the server.
Quote:
2. I have also updated the /etc/yum.repos.d/XXX.repo with baseurl pointing to the repoditory folder. (I assume it should be updated only client end).
Also correct, this is done on the client end. But since you now have the repo not locally available anymore (because it now resides on the server) you need to have an option to make the repository available to the client. You can do that for example by sharing the repository using NFS (in which case you mount that share on the client and point the baseurl to that location) or serving it using a web- or ftp-server (then you use the URL of the repository as value for baseurl).

If you need more help with that post back and I will give you a short tutorial on how to do that using a webserver.
 
Old 05-24-2013, 10:39 AM   #13
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thankyou TobiSGD, for all your valuable replies..
I did ftp setup between RHEL machines, but it was not able to mount the repository at client machine. (I had followed the same steps a month ago and got it working. Now it shows mount error with some permission issues) I will post the steps I followed and the error message.
Meanwhile as mentioned, if you can give that small tutorial on webserver in Ubuntu, it would be of great help.
Thanking all again..

Last edited by tewtechie25; 05-24-2013 at 10:40 AM.
 
Old 05-24-2013, 10:48 AM   #14
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852
Setup a simple webserver:
Code:
sudo apt-get install apache2
Done. The webserver will start automatically and serve the directory /var/www to the net. If you make your repository in that directory or a subdirectory it will be instantly available.
 
Old 05-24-2013, 07:36 PM   #15
tewtechie25
LQ Newbie
 
Registered: Apr 2013
Location: US
Posts: 15

Original Poster
Rep: Reputation: Disabled
Hi,
I tried sudo apt-get install createrepo and it gives the error.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package createrepo

Then I tried #sudo get-cache ^create$
and it was not returning any result.
 
  


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
yum repository vidyasagar6 Linux - Server 1 02-01-2013 03:23 AM
how to yum repository parkarnoor Linux - Newbie 1 01-17-2011 11:52 AM
yum fails with error: Cannot retrieve repository metadata (repomd.xml) for repository dmendonsa Fedora 6 02-10-2010 08:23 PM
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 09:48 AM.

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