Linux 101

How to setup yum repository on rhel7 and rhel8

1[yum repository for http]

url: http://example.comm/yum

#1 create the file

touch /etc/yum.repo.d/httpyum.repo

#2

vi /etc/yum.repo.d/httpyum.repo

#3 write down the data

[http]

name=httpyum

baseurl=http://example.com/yum

enabled=1

gpgcheck=0 

#4 clean the yum cache

Yum clean all

#5 check your yum repository

Yum list all

2[yum repository for dvd on rhel7]

mount point is /media/dvdrhel7

url: file:///media/dvdrhel7

#1 create the file

touch /etc/yum.repo.d/dvdyum.repo

#2

vi /etc/yum.repo.d/dvdyum.repo

#3 write down the data

[dvd]

name=dvdyum

baseurl= file:///media/dvdrhel7/

enabled=1

gpgcheck=0 

#4 clean the yum cache

Yum clean all

#5 check your yum repository

Yum list all

3[yum repository for dvd on rhel8]

mount point is /media/dvdrhel8

url: file:///media/dvdrhel7

#1 create the file

touch /etc/yum.repo.d/dvdyum.repo

#2

vi /etc/yum.repo.d/dvdyum.repo

#3 write down the data

[baseOS]

name=dvdyum

baseurl= file:///media/dvdrhel7/baseOS/

enabled=1

gpgcheck=0 

[AppStream]

name=dvdyum

baseurl= file:///media/dvdrhel7/AppStream/

enabled=1

gpgcheck=0 

#4 clean the yum cache

Yum clean all

#5 check your yum repository

Yum list all

If your setup do not have any problems, you will get the similar message below

#Yum #rhel 7 #rhel 8