HOW TO FIX CENTOS 6 ERROR: YUMREPO ERROR: ALL MIRROR URLS ARE NOT USING FTP, HTTP[S] OR FILE

15/01/2021

In this article I will show how to fix CentOS 6 error: YumRepo Error: All mirror URLs are not using ftp, http[s]

PROBLEM

When trying update CentOS 6 with yum update command getting error:

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

CAUSE

CentOS 6 reached end of life on the 30th November 2020. YUM attempting connect to deprecated repositories. So, we need update deprecated repositories URL’s and point to the vault.

RESOLUTION

To fix this problem you edit /etc/yum.repos.d/CentOS-Base.repo and replace all mirrorlist

1. Go to /etc/yum.repos.d/ directory:

# cd /etc/yum.repos.d/

2. Make copy of original file:

# cp CentOS-Base.repo CentOS-Base.repo.old

3. Open and edit file with any text editor:

# vi CentOS-Base.repo

4. Replace mirrorlist‘s

Replace sections:

[base]
[updates]
[extras]

With following:

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=https://vault.centos.org/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/update/$basearch/
baseurl=https://vault.centos.org/6.10/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras$basearch/
baseurl=https://vault.centos.org/6.10/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

 

5. Clean yum cache

# yum clean all

6. Run again yum update command:

# yum update

Now you can successfully update your CentOS 6.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Nextcloud [Part 1] – Cài đặt Nextcloud trên CentOS 7

Mục lục Chuẩn bị môi trường Cài đặt dịch vụ Web Cài đặt MariaDB Cài đặt PHP 7.2 Cài...
30/12/2020

Moodle [Part 9] – Hướng dẫn các thao tác cơ bản cho người dùng học viên trên Moodle

Tiếp tục series hướng dẫn sử dụng Moodle. Trong bài viết này, Onet sẽ hướng dẫn bạn các thao...
30/12/2020

How to Configure The Network on CentOS7

CentOS 7 uses Network Manager to manage the network. It is a great tool that makes configuring the network on CentOS easy....
29/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Dịch vụ thuê mua proxy US UK uy tín, chất lượng số #1
13/05/2024

Thuê mua proxy Việt Nam: Báo giá & các thông tin MỚI NHẤT
13/05/2024

Dịch vụ thuê mua proxy giá rẻ an toàn, tốc độ cao
13/05/2024

Thuê mua proxy V6 uy tín, chất lượng tại đâu?
11/05/2024

Thuê mua proxy Tiktok tăng doanh thu, hiệu quả cao
11/05/2024