借鑒 https://www.cnblogs.com/binbingg/p/14082610.html
借鑒 阿里:https://help.aliyun.com/document_detail/193569.htm
2020年11月30日CentOS 6 EOL。
CentOS 6操作系統版本結束了生命周期(EOL),Linux社區已不再維護該操作系統版本。
按照社區規則,CentOS 6的源地址http://mirror.centos.org/centos-6/內容已移除,目前第三方的鏡像站中均已移除CentOS 6的源
The whole CentOS 6 is dead and shouldn’t be used anywhere at all
↑報錯說明當前源不再支持Centos6
!!!!重要說明
說明 本文主要說明ECS實例中的相關操作與配置。如果您的服務器不是ECS實例,需保證服務器具有公網訪問能力,并且源地址http://mirrors.cloud.aliyuncs.com需要替換為http://mirrors.aliyun.com。
例如,切換yum源為http://mirrors.aliyun.com/centos-vault/6.10/;切換epel源為http://mirrors.aliyun.com/epel-archive/6/。
centos本地源,運行以下命令編輯CentOS-Base.repo 文件。
vim /etc/yum.repos.d/CentOS-Base.repo
按i進入編輯模式,修改以下內容切換源。
請根據實例不同的網絡類型進行修改,具體內容如下:
專有網絡VPC類型實例
[base]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6[updates]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6[extras]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6
經典網絡類型實例
[base]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyuncs.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6[updates]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyuncs.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyuncs.comm/centos-vault/RPM-GPG-KEY-CentOS-6[extras]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyuncs.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6
編輯完成后,按Esc鍵,并輸入:wq保存退出文件。
運行以下命令編輯epel.repo 文件。
vim /etc/yum.repos.d/epel.repo
按i進入編輯模式,修改以下內容切換源。
請根據實例不同的網絡類型進行修改,具體內容如下:
專有網絡VPC類型實例
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/epel-archive/6/$basearch
gpgcheck=0
gpgkey=http://mirrors.cloud.aliyuncs.com/epel-archive/RPM-GPG-KEY-EPEL-6
yum centos、經典網絡類型實例
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyuncs.com/epel-archive/6/$basearch
gpgcheck=0
gpgkey=http://mirrors.aliyuncs.com/epel-archive/RPM-GPG-KEY-EPEL-6
編輯完成后,按Esc鍵,并輸入:wq保存退出文件。
yum clean all
yum makecache
切換完成后,您可以使用yum install命令安裝需要的軟件包。
把CentOS-Base.repo 里面的東西全部刪掉,添加如下內容即可。
[base]
name=CentOS-6
failovermethod=priority
baseurl=https://vault.centos.org/6.9/os/x86_64/
gpgcheck=0
yum clean all
yum makecache
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态