日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CentOS6.9中使用yum install时提示:Cannot find a valid baseurl for repo: centos-sclo-rh

發布時間:2025/3/19 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS6.9中使用yum install时提示:Cannot find a valid baseurl for repo: centos-sclo-rh 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

場景

CentOS的版本為6.9,在使用yum install 安裝相關依賴時提示:

Cannot find a valid baseurl for repo: centos-sclo-rh

?

注:

博客:
https://blog.csdn.net/badao_liumang_qizhi
關注公眾號
霸道的程序猿
獲取編程相關電子書、教程推送與免費下載。

實現

原因是官方結束了對CentOS6的支持,導致在使用yum安裝或更新程序的時候出現錯誤。

首先清空CenOS-Base.repo文件

echo > /etc/yum.repos.d/CentOS-Base.repo

然后編輯該文件

vi /etc/yum.repos.d/CentOS-Base.repo

然后按鍵盤上的i鍵進入編輯模式,將下面的內容復制進去

[base] name=CentOS-$releasever - Base #mirrorlist=http://#mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra 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=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=https://vault.centos.org/6.10/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus #mirrorlist=http://#mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra baseurl=https://vault.centos.org/6.10/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib #mirrorlist=http://#mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra baseurl=https://vault.centos.org/6.10/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

然后按Esc退出編輯模式,再輸入

:wq!

保存并退出

然后刪除掉/etc/yum.repos.d/目錄下其他無關的repo文件

cd /etc/yum.repos.d/ ls | grep -v 'CentOS-Base.repo' | xargsrm

然后重建yum緩存,更新并啟動新的yum源

yum clean all && yummakecache

此時需要等待一段時間,不要按回車。

?

總結

以上是生活随笔為你收集整理的CentOS6.9中使用yum install时提示:Cannot find a valid baseurl for repo: centos-sclo-rh的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。