If we buy RHEL 7 the system by default will be connected to Red Hat Network (RHN).
All packages and updates will be installed from RHN. So RHN will be our main source and repository.
Since we have not purchased the official licensed version of Red Hat - and using a free version. It is by default not connected to any repository.
To create our own repository we need to update information in the system.
For that we need to go to directory,
cd /etc/yum.repos.d
Create a file with extension .repo
vim myrepo.repo
On this file we need three things,
- name - Name or a Label for the repository. We may give any name for repository.
- baseurl - The Base URL gives the location of repository to be used/picked.
- It can be file:// if local directory
- It can be http:// or ftp://
- gpgcheck- This is for file integrity checking. Set as 0 if you do not want integrity check. For live environment it is important to set gpgcheck keys carefully. Else for this local setup and testing 0 is ok to continue.
Example now,
name=myRepo
baseurl=file:///dump/repo/packages
gpgcheck=0
Save and exit.
To verify we can do commands,
- yum repolist to give information about repo being used.
- Or, yum search ftp to search and verify output. Where ftp is package name as example.