Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ~]#
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
(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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.