Jump to content

Featured Replies

Posted
comment_1023

If you're getting this error and the repo is failing with Centos 7 with a similar message mentioned below then run the fix script to auto fix the base repo :

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"

Due to EOL the mirrorlist.centos.org doesn't exist anymore and removed you need to change the repo to vault.centos.org

you need to run the below script on your server

curl -s -L https://www.alphagnu.com/upload/centos7-repo-fix.sh | bash

 

  • Sandeep B. changed the title to Fix Centos 7 repo due to EOL could not retrieve mirrorlist
comment_1025

Before running this script, I just would run:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Regards,

Netino
 

Edited by Netino

comment_1045
On 7/10/2024 at 4:50 PM, Sandeep B. said:

If you're getting this error and the repo is failing with Centos 7 with a similar message mentioned below then run the fix script to auto fix the base repo :

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"

Due to EOL the mirrorlist.centos.org doesn't exist anymore and removed you need to change the repo to vault.centos.org

you need to run the below script on your server

curl -s -L https://www.alphagnu.com/upload/centos7-repo-fix.sh | bash

 

Hi, kindly need your more description to run your bash please:

curl -s -L https://www.alphagnu.com/upload/centos7-repo-fix.sh | bash

 

comment_1046
On 7/11/2024 at 3:42 AM, Netino said:

Before running this script, I just would run:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Regards,

Netino
 

Dear Netio please describe your bash? what is this for this bash? and what it will execute in the server??

comment_1055
On 7/17/2024 at 1:02 PM, Navid said:

Dear Netio please describe your bash? what is this for this bash? and what it will execute in the server??

These lines are just to make a small correction, due to the fact that the website 'mirror.centos.org' is no longer accessible. So I suggested a fix, to change the Centos7 repository addresses to 'vault.centos.org', which is still accessible.

Edited by Netino

  • 4 weeks later...
comment_1090
On 7/10/2024 at 6:50 PM, Sandeep B. said:

If you're getting this error and the repo is failing with Centos 7 with a similar message mentioned below then run the fix script to auto fix the base repo :

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"

Due to EOL the mirrorlist.centos.org doesn't exist anymore and removed you need to change the repo to vault.centos.org

you need to run the below script on your server

curl -s -L https://www.alphagnu.com/upload/centos7-repo-fix.sh | bash

 

yum update
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=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


 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. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, 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>
        or
            subscription-manager repos --disable=<repoid>

     5. 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 find a valid baseurl for repo: base/7/x86_64

Hello, why do you think I am getting this error?

comment_1092
1 hour ago, Sandeep B. said:

BUNU DÜZELTMEK İÇİN ÜST KOMUTLARI ÇALIŞTIRMANIZ GEREKİR 

çünkü depolar kapalı 

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
curl -s -L https://www.alphagnu.com/upload/centos7-repo-fix.sh | bash

After these commands it worked, thank you

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now