LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Closed Thread
 
Search this Thread
Old 09-17-2008, 02:16 AM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,434
Blog Entries: 6

Rep: Reputation: 51
How to create Local YUM Repository?


I am in verse to create a local YUM repository.I have NFS Repo which has all the RPM Distribution under http://reposerver/RHEL/RHELAS4U532BIT/RedHat/RPMS/ folder.
Whenever I need to install package I have to manually mount it to my system and do rpm installation one by one.

What I have think is to create it as YUM Repo.

Meanwhile I am testing it through one of the Client machine.
My /etc/yum.conf file is :

Code:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
#name= Red Hat Enterprise Linux 4 Update 5
baseurl=http://reposerver/opt/kickstart/RHEL/RHELAS4U532BIT/RedHat/RPMS/
enabled=1
gpgcheck=1
RPms are physically placed under /opt/kickstart directory
Is the entries correct?

When I am trying to run:

# yum install lynx
it says:

Code:
[root@pe ~]# yum install lynx
Gathering header information file(s) from server(s)
Server: Red Hat Enterprise Linux 4 Update 5
retrygrab() failed for:
  http://reposerver:/opt/kickstart/RHEL/RHELAS4U532BIT/RedHat/RPMS/headers/header.info
  Executing failover method
failover: out of servers to try
Error getting file http://10.14.134.183:/opt/kickstart/RHEL/RHELAS4U532BIT/RedHat/RPMS/headers/header.info
[Errno 4] IOError: <urlopen error nonnumeric port: ''>
[root@pe ~]#
Also, I tried browsing the server as :
#htmlview http://reposerver/RHEL/....

Its Working.but not thru yum.
Pls Sugest

Last edited by your_shadow03; 09-17-2008 at 02:19 AM.
 
Old 09-17-2008, 02:29 AM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Look into "createrepo". You may need to install it first (with yum)
 
Old 09-17-2008, 02:42 AM   #3
ashsethi
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Rep: Reputation: 0
createrepo -v /RHEL/RHELAS4U532BIT/RedHat/RPMS/
Try this and then see...

Thanks,
Ash
 
Old 09-17-2008, 03:23 AM   #4
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,434
Blog Entries: 6

Original Poster
Rep: Reputation: 51
I am following the following doc:

Code:
Summary:
Create the directory structure of the repository 
Copy the base RPMs 
Create the base repository headers 
Select an rsync mirror. 
Rsync the updates-released repository 
Edit yum.conf 
Degree of Difficulty:Easy
Requires:Approximately 5 gb of Disk Space
Package: createrepo (su yum -y install createrepo) 



--------------------------------------------------------------------------------

1. Create the Directories:
mkdir -pv /var/www/html/yum/{base,updates} 

--------------------------------------------------------------------------------

2. Copy the RPMs from the CDs/DVD to /var/www/html/yum/base

--------------------------------------------------------------------------------

3. Create the base repository headers: 
"createrepo /var/www/html/yum/base"
This might take some time, depending upon the speed of your processor(s) and HD. On successful conclusion, createrepo should create a directory /repodata. The contents should be:
        filelists.xml.gz, other.xml.gz, primary.xml.gz, repomd.xml

--------------------------------------------------------------------------------

4. Select a rsync mirror for updates:
A list is at http://fedora.redhat.com/download/mirrors.html and these are identified with €œrsync.€ For example: "rsync://distro.ibiblio.org/fedora-linux-core/". The mirrors share a common structure for updates. Simply append /updates/<d version>/<base arch>. Using FC4, this becomes:
rsync://distro.ibiblio.org/fedora-linux-core/updates/4/i386

--------------------------------------------------------------------------------

5. Rsync to create the updates-released repository:
"rsync -avrt rsync://distro.ibiblio.org/fedora-linux-core/updates/4/i386 \
--exclude=debug/ /var/www/html/yum/updates" 

This will create a complete update repository at /var/www/html/yum/updates/i386. The repodata directory will be created with all of the headers. 

At this point you can create a cron job for the rsync command, above. Only new updates and headers will be downloaded to your repository.

--------------------------------------------------------------------------------

6. Edit /etc/yum.conf:
[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever
baseurl=http://192.168.0.xx/yum/updates/$basearch/
enabled=1
gpgcheck=1

[base]
name=Fedora Core $releasever - $basearch - Base
baseurl=http://192.168.0.xx/yum/Fedora/core/$releasever/base/RPMS
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1

On the machine with the repository, substitute localhost for the IP address
I created directory base and update and also installed createrepo rpm and ran the above command.
But what next I need to do and enter into yum.conf
 
Old 09-17-2008, 03:51 AM   #5
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,434
Blog Entries: 6

Original Poster
Rep: Reputation: 51
I have peformed the following commands through the link:http://tqmcube.com/repo.php:

[code]
1. mkdir -pv /var/www/html/yum/{base,updates}
2. cp *.rpm to /var/www/html/yum/base
3. createrepo /var/www/html/yum/base
4. vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
#name= Red Hat Enterprise Linux 4 Update 5
baseurl=http://localhost/yum/base ---------> Is it correct entry?Confused?
enabled=1
gpgcheck=1
 
Old 09-17-2008, 07:29 AM   #6
fareedreg
Member
 
Registered: Dec 2007
Posts: 51

Rep: Reputation: 15
Install local yum in one shot

download this script from rapidshare made by me

http://rapidshare.com/files/146012524/yumscript.html

steps

(1) copy this script anywhere
(2) put your RHEL5 DVD on rom
(3) change mode of this file (chmod 777 yumscript)
(4) run script ./yumscript
(5) sit back and relax for 15 minutes it will copy all your dvd files to your HDD and create yum file also.

(6) test it by give command (yum install bind)

fareed@chemoplast.com
 
Old 09-18-2008, 12:00 AM   #7
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,434
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Dude..
Thanks for the script..
But I want a different setup.I have already collection of all RHEL RPMS already.
I just want to put in a central YUM Repo.And Whenever any RHEL MAchine comes/nwly added/needs packages.
it Should Have entry in yum.conf as per its own architecture and download the package atuomatically with dependencies.
 
Old 08-11-2010, 07:19 AM   #8
ringque
LQ Newbie
 
Registered: Nov 2009
Posts: 18

Rep: Reputation: 0
i tried this but i have found "errono 14 http 404 not found error"
please help me to slove this problem..tnx in advance....
 
Old 02-22-2012, 06:00 AM   #9
ehowstuff
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Rep: Reputation: Disabled
This will very useful when you are running on the slow internet connection. Instead of using the internet connection directly to registered RHEL repository, it is possible to use Local CD/DVD-ROM as your yum repository.

Steps :
1. Insert DVD/ISO into DVD-Drive.
2. Mount the ISO from the DVD-ROM into /mnt directory.

df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
9845280 1328824 8016336 15% /
tmpfs 515660 0 515660 0% /dev/shm
/dev/sda1 495844 28689 441555 7% /boot
/dev/sr0 2862360 2862360 0 100% /mnt

3. vi /etc/yum.repos.d/dvdrhel.repo
[DVD-RHEL6-Repository]
mediaid=1235481171.125642
name=DVD-RHEL6 repository
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
4. Start using yum.
 
Old 04-01-2012, 10:25 AM   #10
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Please don't resurrect old threads to drive traffic to your own site. The forum rules do not permit advertising. Let's this thread rest in peace.
 
  


Closed Thread


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
want to set up local yum repository linmix Linux - Software 4 04-23-2013 03:42 AM
local yum repository tombolio Linux - Newbie 4 09-11-2008 07:28 PM
can i create a local yum repository? Sharaz Linux - General 5 01-21-2008 01:51 PM
how can i add a local Folder on local Hard Disk as Yum Repository ?? vahid_p Fedora 4 02-22-2007 10:43 AM
Can I create a local yum repository without copying DVDs? Charlie Spencer Linux - Newbie 3 09-22-2006 07:32 AM


All times are GMT -5. The time now is 06:13 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration