在 yum.conf 中设置代理

Set proxy in yum.conf

我想知道,如何在 yum.conf 文件中设置代理 - 我在 yum.conf 文件

中指定了代理
proxy=http://username:Password@10.203.190.5:80

这是正确的方法吗?

如果是,我仍然在 "yum update"

收到错误
[root@localhost ~]# yum update
Loaded plugins: langpacks, presto, refresh-packagekit
http://download.fedoraproject.org/pub/fedora/linux/releases/18/Everything/i386/os/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found :             http://download.fedoraproject.org/pub/fedora/linux/releases/18/Everything/i386/os/repodata/repomd.xml
Trying other mirror.
Error: failure: repodata/repomd.xml from fedora: [Errno 256] No more mirrors    to try.
http://download.fedoraproject.org/pub/fedora/linux/releases/18/Everything/i386/os/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found : http://download.fedoraproject.org/pub/fedora/linux/releases/18/Everything/i386/os/repodata/repomd.xml

我也尝试在 bash 上设置代理,但仍然出现相同的错误。

export http_proxy="http://username:Password@10.203.190.5:80"
export https_proxy="http://username:Password@10.203.190.5:80"

请帮忙。

提前致谢。

我是如何拥有它的以及它是如何工作的

/etc/yum.conf

proxy=http://proxy_host:proxy_port
proxy_username=proxy_username
proxy_password=proxy_password

其实在Fedora 18中,我发现baseurl是不可达的。 我更改了 fedora.repo & fedora-updates.repo.

中的 baseurl

fedora.repo -

baseurl=https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/18/Everything/i386/os/
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/

baseurl=https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/18/Everything/i386/debug
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/

baseurl=https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/18/Everything/source/SRPMS/
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/

软呢帽-updates.repo-

baseurl=https://dl.fedoraproject.org/pub/archive/fedora/linux/updates/18/$basearch/
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/

baseurl=https://dl.fedoraproject.org/pub/archive/fedora/linux/updates/18/$basearch/debug/
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/debug/

baseurl=https://dl.fedoraproject.org/pub/archive/fedora/linux/updates/18/SRPMS/
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/SRPMS/

这些更改后 yum 更新 正常工作。

谢谢。