Skip to main content

Setup Local Yum Repository in RHEL/CentOS

Hello Friends, 

This Topic is about setup Local DVD Yum (Yellowdog Updater Modifier) Repository in Red Hat Enterprise Linux or CentOS (applicable to all version). To install Software in RHEL or CentOS we need rpm packages. we have two different tools to install any software one is 'rpm' and another is 'yum'. RPM stands for Red Hat Package Manager, it is used to install software package with a .rpm extension file, it installs packages with a single file and does not process its dependencies (if required). and second one is YUM it stands for Yellowdog Updater Modifier. it is the best tool to install software packages in RHEL/CentOS, before installing packages via YUM we need to configure YUM repositories, It is also available online, many open-source development programs offers online repositories. Here we will learn to setup Local Repository with RHEL/CentOS 7 DVD. 


To Setup Yum repository we would require :

RHEL OS DVD 
'createrepo' package


1. Mount OS DVD in Server to /dvd mount-point and copy all contents to a OS Directory /localrepo

# mkdir /dvd
# mount /dev/sr0 /dvd

Following command will copy all contens of /dvd to /localrepo

# mkdir /localrepo

# cd /dvd
# find . | cpio -pmdv /localrepo/

Keep patience It will take some time to complete. 


2. Checkup if 'createrepo' package is available or not, if not available install it manually

# rpm -qa | grep -i createrepo

# cd /localrepo/Packages
# rpm -Uvh createrepo-x.xxxxx.rpm


3. Run createrepo to create Repository Database 

# createrepo -v /localrepo

Keep patience It will take some time to complete. 


4. Create a .repo file in '/etc/yum.repos.d/' location to read repository data and package files

# cd /etc/yum.repos.d/
# vi local.repo

[Local]
name=Local_Repository
baseurl=file:///localrepo
enabled=1
gpgcheck=0 
 
5. Save above file and check for repository

# yum clean all
# yum repolist 

Above command will show information of available repository. 

Try to install any package with YUM 

# yum install bind -y

It will install 'bind' package along with its all dependencies. 


Hope You are now able to configure Local DVD Repository !!

||Thanks for Reading ||
Comment your suggestions and opinions in comment box !!


Comments

Post a Comment

Popular posts from this blog

Mount ISO image in HP-UX 11i v3

ISO image is an archive file that could be written to a optical disc(CD/DVD). ISO images can be created from optical discs by disc imaging software (freely available on internet) or from a collection of files.  In HP-UX 11i v3 by default we can't mount .iso images we need a kernel module "fspd". it is Dynamically Loadable Kernel Module (DLKM).we need to install ISOIMAGE-ENH product which deliver this fspd DLKM. You can download this product by following link : https://h20392.www2.hpe.com/portal/swdepot/displayProductInfo.do?productNumber=ISOIMAGE-ENH After installation of ISOIMAGE-ENH load fspd module  To Load fspd Module # kcmodule fspd=loaded To unload fspd Module # kcmodule fspd=unused And here is how it works very simply: Create a directory to mount iso image on it.  # mkdir /rhel_iso # mount /soft/iso_images/RHEL-5.1-IA64-CD1.iso /rhel_iso Share my Blog and post questions and opinions in  comments !!

Update HP-UX Operating Environment (OE)

Hello Readers, Today I am describing how to update Operating Environment of HP-UX Operating System, Update OE steps are written below. Have a look.... 1. Check current OE version details 2. Download CD/DVD of Latest Operating Environment or HP-UX Operating System. 3. Create a Depot of OS Depot to update.  4. Run update in preview mode for any errors and warnings.  5. If update runs in preview mode successfully, Run update without Preview mode.  1. Checkup current OE version details # swlist | grep -i OE    HPUX11i-VSE-OE       B.11.31.1603   HP-UX Virtual Server Operating Environment You may see in output, currently it is of  March 2016 Virtual Server Operating Environment 2. Download CD/DVD of Latest Operating Environment or HP-UX Operating System. First download latest iso of HPUX Operating System and create a software depot from it How to mount iso images in HPUX system you may study my anoth...

HP-UX 11.31-Restore a single file/Directory from Ignite Backup (Tape and Net Recovery)

Hello Friends, This topic is related with HP-UX Operating System. In HP-UX Operating System Ignite is one of the hpux feature by which OS recovery image is being created in ignite server and external Tape cartridges which can be later used to restore OS in case of system crash. (In later Posts I will write about ignite server setup and ignite restoration techniques). Today I will write how to restore a single file or Directory from ignite backup in two cases, First is when we have ignite backup on Tape cartridge and Second is when we have ignite backup in Ignite Server. 1. From the Ignite Tape (assuming 2mn for tape device): # mt -f /dev/rmt/2mn rewind # mt -f /dev/rmt/2mn fsf 1     <– for PA-RISC System (and) # mt -f /dev/rmt/2mn fsf 22    <– for Itanium/Integrity System Use below command to restore file '/etc/lvmtab' # tar xvf /dev/rmt/2mn  etc/lvmtab NOTE : No leading '/'  (absolute path is to be used at time of restorati...