Centos – Yum configuration through a proxy necessary

centospackage-managementrepositoryyum

I'm trying to get my yum configuration to work again but it stops at the following:

  yum update--verbose
  Config time:0.091
  Yum Version: 3.2.22
  Setting up Package Sacks
  Loading mirror speeds from cached hostfile

At the last line yum just hangs indefinitely. I noticed that there the http_proxy variable was not set and there is nothing in /etc/yum.conf that indicates a proxy but if I do set http_proxy using the following commands:

  export http_proxy=http://localhost:8080/

and then in /etc/yum.conf I set:

  proxy=http://localhost:8080/

I get the following error when running the same command above:

  yum update--verbose
  Config time:0.091
  Yum Version: 3.2.22
  Setting up Package Sacks
  Loading mirror speeds from cached hostfile
  Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons error was
  [Errno 4] IOError: <urlopen error (111, 'Connection refused')>
  Error: Cannot find a valid baseurl for repo: addons

The contents of the directory /etc/yum.repos.d is

  CentOS-Base.repo CentOS-Base.repo.rpmnew CentOS-Media.repo trixboxaddons.repo trixboxbeta.repo trixboxdevel.repo trixbox.repo

I also made sure that each of those repo files don't have https. How can I fix yum to update?

EDIT: It seems that I did not have a proxy running at a local machine. I removed the proxy information and yum gets stuck at loading mirror speeds from cached hostfile.

If I run the following command:

  yum update --verbose --noplugins
  Config time: 0.085
  Yum Version: 3.2.22
  Setting up Package Sacks

and yum just hangs at setting up package sacks. I did an nslookup for google.com and it returns IP addresses which means my DNS should be fine. What else could cause it to hang?

Best Answer

Odds are if you're asking about yum proxies, you don't have one running on your local machine. Don't set yum to use your local machine as a proxy.

Try doing a yum clean all, then attempting your update. It's possible you have bad local metadata and you need to start fresh. Disable all yum plugins as well, keep the config as simple as possible. If that doesn't work, make sure your gateway and DNS resolution work. Yum is dead simple, if HTTP isn't working then yum won't work either.