skip to Main Content

Not able to run yum update. It fails with the message connection refused.

When I run sudo yum update I get the following message

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=genclo error was
14: curl#7 - "Failed connect to localhost:3000; Connection refused"

I am able to connect to internet.

2

Answers


  1. This is my solution.

    1. Find your appropriate version on next site (in this example I’m using 7.0.1406):

      https://vault.centos.org/

    2. Execute next commands to update your yum configuration files:

      sed -i -e ‘s/mirrorlist=/#mirrorlist=/g’ /etc/yum.repos.d/CentOS-*

      sed -i -e ‘s/mirrorlist=/#mirrorlist=/g’ /etc/yum.conf

      sed -E -i -e ‘s/#baseurl=http://mirror.centos.org/centos/$releasever/([[:alnum:]_-]*)/$basearch//baseurl=https://vault.centos.org/7.0.1406/1/$basearch//g’ /etc/yum.repos.d/CentOS-*

      sed -E -i -e ‘s/#baseurl=http://mirror.centos.org/centos/$releasever/([[:alnum:]_-]*)/$basearch//baseurl=https://vault.centos.org/7.0.1406/1/$basearch//g’ /etc/yum.conf

    Good Luck!

    Login or Signup to reply.
  2. you can try this:

    • sudo sed -i -e ‘s/mirrorlist=/#mirrorlist=/g’ /etc/yum.repos.d/CentOS-*

    • sudo sed -E -i -e ‘s/#baseurl=http://mirror.centos.org/centos/$releasever/([[:alnum:]_-])/$basearch//baseurl=https://vault.centos.org/7.0.1406/1/$basearch//g’ /etc/yum.repos.d/CentOS-


    • sudo sed -E -i -e ‘s/#baseurl=http://mirror.centos.org/centos/$releasever/([[:alnum:]_-]*)/$basearch//baseurl=https://vault.centos.org/7.0.1406/1/$basearch//g’ /etc/yum.conf

    and then:
    sudo yum -y update

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search