https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/
CentOS 7 reached its End of Life (EOL) on June 30, 2024. When software reaches EOL, the developer no longer supports the OS, meaning there will be no more updates, potentially causing repository issues. To continue using CentOS 7, you can update your repository configuration or consider upgrading to a supported OS.
Solution:
Follow these steps to update your CentOS 7 repository configuration:
Step 1: Connect to Your VPS via SSH
Open your terminal and connect to your VPS using SSH:
ssh your_username@your_server_ip
Step 2: Edit the CentOS Repository Configuration File
Use vi or your preferred text editor to open the CentOS repository configuration file:
sudo vi /etc/yum.repos.d/CentOS-Base.repo
Step 3: Update the Repository URLs
Locate the following lines in the file:
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://centos.mirror.serveriai.lt/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Replace them with one of the following options:
Option 1: Using the CentOS Vault
[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Option 2: Using a Mirror Server
[base]
name=CentOS-$releasever - Base
baseurl=https://centos.mirror.serveriai.lt/7.9.2009/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Step 4: Save the Changes
To save your changes in vi
, press Esc
and type :wq
, then press Enter.
Step 5: Verify the Changes
Run the following command to verify that the changes were applied correctly:
sudo yum list
If everything is set up correctly, you should see the updated package list.
Conclusion
By updating the repository URLs, you can continue to receive updates for CentOS 7 from the CentOS Vault or a mirror server. However, consider planning to upgrade to a supported OS for continued security and stability.