yum 无效或禁止的端口

yum 无效或禁止的端口

我在非标准端口 4080 上有一个 http 存储库。

当尝试检索包列表时失败:

# 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

该网址有效:

# 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">

答案1

如果您无论如何都要绑定到环回接口,则可以简单地使用:

file://path/to/repo

来源:https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s1-yum-yumconf-repository.html

相关内容