Advertisement

Responsive Advertisement

How to create Repository in Linux

How to create Repository in Linux(Appstream and BaseOs) in RHEL8 

First one why should create a repository. What is the role or use of repository in Linux. 
There are basically two repository are mainly use in Linux to download packages(Software's). 
1.Appstream
2.BaseOs
Above two repository are needed to download packages in Linux.

1. First we check the repository using yum repolist all



 No repositories available here.

2.First we mount file on opt using this command:-
    mount /dev/sr0 /opt



Here mounting is successful.
Check mounting using df -h command



3. Change directory cd /etc/yum.repos.d/



    Here we read our first repository file using cat command -
    cat redhat.repo  No repository are available
 


4.Create a new file:- vim rhel8.repo





5.Create our repository Appstream and BaseOs. Use this code copy and paste.

    
First go in insert mode Press  'i'  button on keyboard Then Copy this.

[root@RHEL8 ~]# vi /etc/yum.repos.d/rhel8.repo
[InstallMedia-BaseOS]
name=Red Hat Enterprise Linux 8 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///opt/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


[InstallMedia-AppStream]
name=Red Hat Enterprise Linux 8 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///opt/AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


After paste save file using  esc :wq  Enter



6. Check repository using yum repolist all command. And here both repository are created successfully in enabled mode.



7. Know we can remove this subscription message also.



 
   To hide the "system not register message" use below command
    vi /etc/yum/pluginconf.d/subscription-manager.conf 


   Go in insert mode and  Change enable=1 to enable=0



And save file using esc :wq enter




Watch Our Video Tutorial :-

















Post a Comment

0 Comments