What do you someone breaks something? I post the solution here...

Kubernetes (K8s/K3d) / Terraform / Ansible / Linux / AWS / Docker / Bash / Python / ELK / CI/CD / Java / Traefik / Nginx / CentOs / Ubuntu


Setting up YUM on my local machine 😎




 
Setting up YUM on my local machine 😎  


  

   Why YUM ?

         Yum is an automatic updater and package installer/remover for rpm systems,But i think rpm also does the same thing then why do we need yum ?Yes rpm also does the package management in rpm based machines but it does not handle dependency resolution which is taken care very well by yum

       It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain group of machines without having to manually update each one using rpm. Yum has a plugin interface for adding simple features. Yum can also be used from other python programs via its module interface.

       It has been so much of theory i guess, lets jump into the practicals

Note: This post is tested on rhel 5.7 and will work well on 5.x(works well for all rpm based machines) i will drop comments for rhel 6 and 7 , This is tested on Vmware Workstation


Pre-requisites: 
          
         One RHEL/Centos (5.x)  machine on Vmware or Virtual Box, I have used Vmware workstation and RHEL 5.7 in this article


Steps:

1. Attach the CD/DVD to the Virtual Machine 
2. Mount it to File System or Directly user the files from /media
3. Install Createrepo Application(program using rpm)
4. Create a Repository folder on your local Machine and copy all  files from disk to this folder
5. Make the folder as repository using Createrepo 
6. Make a configuration file in /etc/yum.repos.d/ and import gpg keys using rpm
7. Have fun using yum😉



Step 1:

Attach the CD/DVD to VM

Goto VM>> Removable Devices >> CD/DVD(SATA) >> Setting





      

    

   We Just need to check the connected box and second one is optional if you to connect it automatically when booting is also fine




  If Every thing goes fine then we should see the some thing like this posted in screenshot below if not then there is some mistake done while following this article


This indicates the completion of step 1 we have attached the ISO cd/dvd to the virtual machine 


Step 2:

Mount it to File System or Directly user the files from /media

Here i have directly accessed the files from the cd/dvd we can also do by mounting the cdrom to /mnt 


Step 3:

Install Createrepo Application(program using rpm)

   rpm -ivh Server/Createrepo-<version>.rpm



Step 4:

Create a Repository folder on your local Machine and copy all  files from disk to this folder

mkdir -p /RHEL/PackageFiles

-p : parent


check if it is created 



We have created the folder now lets copy the all the packages from the cd/dvd to the folder we just created

cp -Rvf /media/RHEL*/Server /RHEL/PackageFiles

R: Recursively
v:verbose
f: forcefully






    Please wait for 5-7 minutes it depends on the PC performance  as it copies approx 2455 files 


Step 5:

Make the folder as repository using Createrepo 

createrepo -v  /RHEL/PackageFiles/Server



This also will take some 5-7 minutes



Step : 6

Make a configuration file in /etc/yum.repos.d/ and import gpg keys using rpm






 Time to test if everything went correct


Hurray Done !!! Lets try installing Vim


yum install vim









I will be happy to help, do contact me on timime687@gmail.com , Suggestions are most welcome
Thank you 


No comments:

Powered by Blogger.