Yum Software Package Manager : Creating Your Own Repo Location

You can create your own Repository. In this example we will assume that we have some downloaded RPM files. For these RPM files we are going to create our own Repo Location as below.

Example Scenario :

In our Lab there is location http://10.0.0.1/Soft/. We have kept some RPM Files for local download. You can try these files.

  • Download Location : http://10.0.0.1/Soft/
  • Files To Download :

lshw-2.17-1.el7.rf.x86_64.rpm
ntfs-3g-2015.3.14-2.el7.x86_64.rpm
webalizer-2.21_02-3.3.el6.x86_64.rpm

  • Local Download Folder : /Soft
  • Repo Name : MySoft

1. First create folder as below.
# mkdir /Soft

2. Install createrepo Package as below.
# yum install createrepo -y

3. Now download the above files using wget command as below.

# cd /Soft
# wget http://10.0.0.1/Soft/lshw-2.17-1.el7.rf.x86_64.rpm
# wget http://10.0.0.1/Soft/ntfs-3g-2015.3.14-2.el7.x86_64.rpm
# wget http://10.0.0.1/Soft/webalizer-2.21_02-3.3.el6.x86_64.rpm

4. Now run createrepo command as below.
# createrepo -v /Soft

You should be able to see following output.

Yum.ht4
5. That’s All ! You have successfully created your own Repo in /Soft
6. Now its time to add this Repo Location in your repo file located in /etc/yum.repos.d folder. Edit you /etc/yum.repos.d/mydvd.repo file and append following lines there.

[MySoft]
name=Software in /Soft Folder
baseurl=file:///Soft
enabled=1
gpgcheck=0

7. Now run
# yum clean all
# yum repolist

You should be able to see new Repo Location.