As I mentioned in my previous tutorials about local repositories, if you have to install software, security updates and fixes often in multiple systems in your local network then having a local repository is an efficient way. Because all of the required packages are downloaded over the fast LAN connection from your local server, so that it will save your internet bandwidth and reducing your annual cost of internet connection bandwidth.

Prerequisites

First switch to root user using the following command:

$ su

Enter the root user password to switch to root user. Now you will able to run all commands without necessary to put sudo before every commands.

Install FTP server

Install vsftpd package and make the packages available over FTP to your local clients:

# yum install vsftpd

Enable and start vsftpd service using the following commands:

# systemctl enable vsftpd.service
# systemctl start vsftpd.service

We have to install a package called createrepo in-order to create a local repository:

# yum install createrepo

Copy all RPM files to FTP root folder

Create a directory called repository under FTP root directory ie. /var/ftp/ to restore all RPM files:

# mkdir /var/ftp/repository

Mount your Fedora 19 DVD in any location. For instance, I am going to mount it under /mnt directory:

# mount /dev/cdrom /mnt/

Now Fedora 19 DVD has been mounted under /mnt directory. Copy all RPM files using the following command:

This is because your firewall and SELinux may be preventing your client access to the local repository server. So run the following commands in your Yum server to allow the default firewall port 21 through your firewall/router:

# iptables -A INPUT -p tcp --dport 21 -j ACCEPT

Restart the firewall using the following command:

# systemctl restart firewalld.service

And update the SELinux booleans for FTP service:

# setsebool -P ftp_home_dir on

Now try again to update repository in the client side:

# yum update

Now you won’t get the error shown above and you will able to install packages from your local Yum repository server.