Centos 7 repositories does not work anymore

From Kolmisoft Wiki
Revision as of 11:00, 5 July 2024 by Gilbertas (talk | contribs) (Created page with "= Centos 7 EOL = Centos 7 reached EOL (End of Life) on 30 June 2024. mirrorlist.centos.org is already unreachable. yum update will show errors: [root@localhost ~]# yum update Loaded plugins: fastestmirror Determining fastest mirrors 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" Could not retrieve mirrorlist http://mirrorlist....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Centos 7 EOL

Centos 7 reached EOL (End of Life) on 30 June 2024. mirrorlist.centos.org is already unreachable. yum update will show errors:

[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
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"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

How to fix repositories

If MOR/M2/M4 is already installed on the system, the easiest way is to use our script:

/usr/src/k_framework/maintenance/c7_repo_fix.sh

Or manually change repositories:

cd /etc/yum.repos.d/
sed -i s%^mirrorlist=http%#mirrorlist=http%g Cent*.repo
sed -i s%mirror.centos.org%vault.centos.org%g Cent*.repo
sed -i s%^#.*baseurl=http%baseurl=http%g Cent*.repo
yum clean all && yum makecache
cd -

Main repo file /etc/yum.repos.d/CentOS-Base.repo looks like this after changes:

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates 
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  1. additional packages that may be useful

[extras] name=CentOS-$releasever - Extras

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

baseurl=http://vault.centos.org/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

  1. additional packages that extend functionality of existing packages

[centosplus] name=CentOS-$releasever - Plus

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

baseurl=http://vault.centos.org/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7