为什么 yum 试图通过代理和其他奇怪的行为?

为什么 yum 试图通过代理和其他奇怪的行为?

我偶尔会设置一个 SSH 隧道代理,让我看起来像是从另一个位置使用互联网。我将其设置为:

ssh -D 8080 <remote host>

并使用 gnome shell 网络设置对话框将代理设置为http://localhost:8080

目前代理设置为“无”,并且我的ssh连接已断开。

我的互联网浏览工作正常。然而我无法使用yum:

[root@Eiger yum.repos.d]# yum update
Loaded plugins: langpacks, refresh-packagekit
http://linuxdownload.adobe.com/linux/x86_64/repodata/repomd.xml: [Errno 14] curl
#7 - "Failed connect to localhost:8080; Connection refused"
Trying other mirror.
   <repeated 9 more times>

 One of the configured repositories failed (Adobe Systems Incorporated),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable adobe-linux-x86_64

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=adobe-linux-x86_64.skip_if_unavailable=true

failure: repodata/repomd.xml from adobe-linux-x86_64: [Errno 256] No more mirrors to try.
http://linuxdownload.adobe.com/linux/x86_64/repodata/repomd.xml: [Errno 14] curl
#7 - "Failed connect to localhost:8080; Connection refused"
   <repeated 9 more times>

如果我禁用该adobe-linux存储库,那么它只会显示:

[root@Eiger yum.repos.d]# yum update
Loaded plugins: langpacks, refresh-packagekit


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: fedora/19/x86_64. Please verify its path and try again

奇怪的是它不知道发生故障的存储库的名称第二次。这也很奇怪它不会尝试我配置的任何其他存储库(fedora、fedora-updates、google-chrome、google-talkplugin、insync、intellinuxgraphics、rpmfusion-free、rpmfusion-free-updates、rpmfusion-nonfree、rpmfusion-nonfree-updates)。

这已经工作了一年多了,我还没有碰过/etc/yum*


我让电脑进入睡眠状态,一天后将其唤醒。 现在一切正常。 我无法解释昨天看到的行为,但我无法再重现它。

答案1

我确认我的 YUM 配置文件/etc/yum.conf不包含任何proxy定义:

[main]
proxy=http://localhost:8080
proxy_username=put_proxy_user_name_here
proxy_password=put_proxy_user_password_here

还要确保.conf下面的其他文件/etc/yum.repo.d/*都没有提及代理详细信息。

我还将通过使用 的yum详细功能进一步调试该问题:

$ yum -v ....

答案2

删除缓存解决了

rm -Rf /var/cache 

并新建一个文件夹

mkdir /var/cache 

这对我有用。

相关内容