YUM (Yellowdog Updater Modified) is an open source package management tool for RPM (RedHat Package Manager) based Linux systems. It allows to easily install, update, remove or search software packages on a systems.
OS - CentOS 7
IP - 172.17.20.110
Package - Createrepo
Step 1
Install Createrepo Package :
yum install createrepo httpd
Step 2
Copy ISO file of CentOS 7 everything OR download from internet it’s approx 6-7GB.
Note : - In this tutorial we used a CentOS 7 64bit Minimal and copy in “iso” directory
ls /iso
Create repo directory - select name according to your project
mkdir /var/www/html/linuxtopic
Step 3
Mount CentOS 7 ISO
mount -o loop /iso/CentOS-7-x86_64-Minimal-1708.iso
cd /mntls
Copy Packages in repo directory
rsync -av /mnt/Packages/ /var/www/html/linuxtopic/
Step 4
Generate yum repository
createrepo /var/www/html/linuxtopic
Your repo generated successfully , you can check repodata folder
ls -l /var/www/html/linuxtopic/repodata/
Restart httpd server
systemctl restart httpdSystemctl status httpd
Step 5
Go to Client and Add repo entry in yum.repo.d, create any file add following entry
vi /etc/yum.repos.d/linuxtopic.repo
[linuxtopic]
name=linuxtopic yum repo
baseurl=http://172.17.20.110/linuxtopic
enabled=1
gpgcheck=0
[linuxtopic] = Repository name
baseurl=http://172.17.20.110/linuxtopic = base url of yum server
enabled=1 = 1 = enable / 0= disable
gpgcheck=0 = 0 = disable / 1 = enable
Step 6
Install Package
yum clean expire-cache ; sudo yum --disablerepo="*" --enablerepo="linuxtopic" install package-name
Ex
yum clean expire-cache ; sudo yum --disablerepo="*" --enablerepo="linuxtopic" install chrony
Step 7
Update yum repository
Download / copy rpm package in /var/www/html/linuxtopic directory
yum --downloadonly --downloaddir=/var/www/html/linuxtopic/ vim*
Update Repository
createrepo --update /var/www/html/linuxtopic
Thanks,
Please share, like and follow us