+ -

Pages

Monday, September 2, 2013

CREATING CUSTOM REPOSITORIES

http://vishalthakur.com

Creating Local Repositories

Step 1. Mount the source to the local system

Mount the source DVD/CD or ISO file to the local system using this cmd:
Example:
# mount –o loop /source-dvd.iso /media

Step 2. Copy the source to the local media.

Example:
# mkdir /localrepo
#cp –R /media/* /localrepo

Step 3. Create a repo file for the local repo:

Example:
#vi /etc/yum.repod/local.repo
This will open up a new blank file in vi editor. Include this text in the file and save it:
[LocalRepo]
name=local-repo
baseurl=file:///localrepo/media
enabled=1
gpgcheck=0

Step 4. Check the newly created reposiotry:

Running a quick update or installing a program from the repository is the fastest and best way of checking if its working fine.
# yum update
This cmd should update the repo database and you’ll see it coming back without any errors – this means the repo we just built is working fine.
# yum install java
If everything has been installed and configured correctly, this cmd should result in the installation of the latest (available) version of Java on your system.
All done!

Using Remote Repositories

Step 1. Find a repository that you would like to use

If you want to use a remote repository on a system that hasn’t got it enabled by default, it is possible to do so. You need to find out the specifics of that repository and then create a repo file to be used for that purpose.
For example, you can use a CentOS repo for a RHEL installation. It will work fine for most packages – some might not perform the way expected as this is a repo for a different repo, even if the source happens to be the same.

Step 2. Create the .repo file

For this example, we’ll create a CentOS repository
# vi /etc/yum.repos.d/centos.repo
Insert this text in the file and then save it:
[centos]
name=CentOS $releasever - $basearch
baseurl=http://ftp.heanet.ie/pub/centos/6/os/$basearch/
enabled=1
gpgcheck=0
Step 3. Check the repository
# yum install wget
If the repo is working fine, the program will be downloaded and installed on the system.
All done!
5 RakshaTec: CREATING CUSTOM REPOSITORIES http://vishalthakur.com Creating Local Repositories Step 1. Mount the source to the local system Mount the source DVD/CD or ISO file ...

No comments:

Post a Comment

< >