How to create a local yum repository for Centos/Redhat/Fedora

In this tutorial, How to create a local yum repository for Centos/Redhat/Fedora.

Step 1: mount your ISO file

Create folder path /mnt/dvd

[huupv@huupv huuphan.com]$ sudo mkdir -p /mnt/dvd

If you used a physical DVD

[huupv@huupv huuphan.com]$ sudo umount /dev/sr0
[huupv@huupv huuphan.com]$ sudo mount -t iso9660 -o ro /dev/sr0 /mnt/dvd

If you used an IOS file

[huupv@huupv huuphan.com]$ sudo mount -t iso9660 -o loop,ro /opt/CentOS-7-x86_64-Minimal-1511.iso /mnt/dvd

Step 2: Create the repository

I'll use vi editor.

[huupv@huupv huuphan.com]$  vi /etc/yum.repos.d/local.repo

Add the following lines:

[local]
name=Local DVD or ISO repository
baseurl=file:///mnt/dvd
gpgcheck=0
enabled=1

Step 3: Test your local repository

I installing nginx package using local repository.

[huupv@huupv huuphan.com]$  yum install --disablerepo="*" --enablerepo="local" nginx
How to create a local yum repository for Centos

Comments

Popular posts from this blog

zimbra some services are not running [Solve problem]

Bash script list all IP addresses connected to Server

How to install php7 on centos 6