https://www.cnblogs.com/binbingg/p/14082610.htmlから
学ぶAliから学ぶ:https://help.aliyun.com/document_detail/193569.htm
2020年11月30日のCentOS6EOL。
CentOS 6オペレーティングシステムバージョンはライフサイクル(EOL)を終了し、Linuxコミュニティはこのオペレーティングシステムバージョンを維持しなくなりました。
コミュニティルールに従って、CentOS 6 http://mirror.centos.org/centos-6/のソースアドレスが削除され、CentOS6のソースがサードパーティのミラーサイトから削除されました。
The whole CentOS 6 is dead and shouldn’t be used anywhere at all
↑エラーは、現在のソースがCentos6をサポートしなくなったことを示します
解決策1(アリ):
!!!!重要
説明この記事では、主に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-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
従来のネットワークタイプの例
[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
切り替えが完了したら、yuminstallコマンドを使用して必要なソフトウェアパッケージをインストールできます。
解決策2:解決策2:
CentOS-Base.repoのすべてを削除し、次のコンテンツを追加します。
[base]
name=CentOS-6
failovermethod=priority
baseurl=https://vault.centos.org/6.9/os/x86_64/
gpgcheck=0
yumはすべて
yummakecacheをクリーンアップします