Quick notes on how to create a Yum repository and mount it over SSHFS as a local repo.

On the server side (that is where the Yum repo actually lives):

1. Install the "createrepo" package:

yum install createrepo -y

2. Create a directory to use as the repo container:

mkdir -pv /yumrepo

3. Copy RPMs into the repo directory:

cp /root/rpmbuild/RPMS/x86_64/*.rpm /yumrepo/

4. Index the files:

createrepo /yumrepo

On the client side:

1. Install the EPEL repo and the fuse-sshfs package:

yum install epel-release -y
yum install fuse-sshfs -y

2. Create a directory to use as mountpoint:

mkdir -pv /mnt/yum-sshfs

3. Mount the SSH share (for this to work key-based authentication must be setup already!)

sshfs root@10.42.226.2:/yumrepo /mnt/yum-sshfs

4. Add a yum configuration /etc/yum.repos.d/sshfs.repo:

[sshfs-repo]
name=SSHFS repo
baseurl=file:///mnt/yum-sshfs
enabled=1
gpgcheck=0

5. Test - you should get the list of available packages:

yum --disablerepo=* --enablerepo=sshfs-repo list available

Sources: