Se você estiver vinculado à interface de loopback de qualquer maneira, basta usar:
file://path/to/repo
Fonte: link
Eu tenho um repositório http em uma porta não padrão 4080.
Ao tentar recuperar a lista de pacotes, ela falha:
# yum install aaa
Loaded plugins: security, versionlock
http://localhost:4080/rhel6/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Invalid or prohibited port"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: instmedia-rhel6. Please verify its path and try again
_
# cat /etc/yum.repos.d/instmedia-rhel6.repo
[instmedia-rhel6]
name=RHEL Installation Media DVD
baseurl=http://localhost:4080/rhel6
enabled=1
gpgcheck=0
O URL é válido:
# curl --silent http://localhost:4080/rhel6/repodata/repomd.xml | head
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
<revision>1411732962</revision>
<data type="group">
<checksum type="sha256">f02bd293e27f03da8e2ada3b08eac625c564b365fae6d2a673c0478a368df010</checksum>
<location href="repodata/f02bd293e27f03da8e2ada3b08eac625c564b365fae6d2a673c0478a368df010-comps-Server.x86_64.xml"/>
<timestamp>1411732941</timestamp>
<size>1160392</size>
</data>
<data type="filelists">
Se você estiver vinculado à interface de loopback de qualquer maneira, basta usar:
file://path/to/repo
Fonte: link