10

I have a VM running CentOS 7 that I have not used for a long time. Today I launched it and tried to update the CentOS system to the latest version using yum update, but I got a lot of errors:

Loaded plugins: fastestmirror, langpacks http//bay.uchicago.edu/centos/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found Trying other mirror. http//mirror.cs.pitt.edu/centos/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found Trying other mirror. http//mirror.anl.gov/pub/centos/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden Trying other mirror. http//mirror.pac-12.org/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found Trying other mirror. http//centos.expedientevirtual.com/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found Trying other mirror.

Many other similar errors are omitted ...

Trying other mirror. Loading mirror speeds from cached hostfile * base: bay.uchicago.edu * epel: csc.mcs.sdsmt.edu * extras: mirror.ancl.hawaii.edu * nux-dextop: li.nux.ro * updates: centos-distro.cavecreek.net No packages marked for update

I deleted the colon after http in the above error messages to avoid warnings. I think these errors might come from the CentOS version I am using: 7.0.1406 -- since current latest version is a new one, say, 7.0.1588 or something, the corresponding path does not exist and hence the HTTP error 404. But how to have my current CentOS automatically adjust the path name to the latest version and be able to update from the correct URL? Thanks.

  • 2
    Did you try running "yum clean all" to clean all metadata? – user1403360 Jun 18 '15 at 6:06
  • 1
    @user1403360: Yes, it works! Could you please promote this comment as an answer? I will accept it. – user280121 Jun 18 '15 at 7:25
  • I wrote an answer. I either can't or don't know how to promote the comment. – user1403360 Jun 18 '15 at 8:59
  • Please check the proxy settings (If your network has a proxy). – Rajeev Rahman May 10 '16 at 6:21
16

Run the following command to clean the metadata:

yum clean all

This will clean all yum caches including cached mirrors of your yum repositories. On the next run it will get a new list of mirrors.

  • 1
    Good to see your answer. Could you expand on it a little and perhaps explain why this will resolve the OP's issue, please? That way it's more likely to be of use to other people in the future, too. – roaima Jun 18 '15 at 9:26
3

The CentOS-Base.repo file in /etc/yum.repos may have changed since you installed. Current mirror list is as below, with the baseurl= line commented out.

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

  • this is what i have which isnt working – Brian Thomas Jan 19 at 3:31
1

That's because that version centos-7.0.1406 is deprecated. You should use /7/ and not /7.0.1406/ in your path.

You can find your repo details in the following path.

/etc/yum.repos.d

By adding the below lines in the repo file you can point to centos 7.

[extrascentos7]
name=Extras packages for CentOS 7 for x86_64
baseurl=http://mirror.centos.org/centos/7/extras/x86_64/
enabled=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.