Linux中yum命令映象源和出錯解決方案

2022-07-14 10:24:08 字數 842 閱讀 5972

更換源方法如下:

在映象站首頁找到自己的linux版本(我的是centos 7.4),點選help。新開啟的網頁中詳細的說明了如何備份,如何更換映象源(在linux的terminal中):

1、備份

mv /etc/yum.repos.d/centos-base.repo /etc/yum.repos.d/centos-base.repo.backup

centos5:

wget -o /etc/yum.repos.d/centos-base.repo 

centos6:

wget -o /etc/yum.repos.d/centos-base.repo

centos7:

wget -o /etc/yum.repos.d/centos-base.repo

3、之後執行yum makecache生成快取

yum clean all

yum makecache

[errno 14] pycurl error 22 - "the requested url returned error: 404 not found" trying other mirror.

[errno 14] pycurl error 7 - "couldn't connect to host" trying other mirror.

[errno 256] no more mirrors to try.

有效的解決方法:​

yum clean all

rpm --rebuilddb

linux修改yum源映象源

修改centos預設yum源為國內yum映象源 1 首先備份系統自帶yum源配置檔案 etc yum.repos.d centos base.repo 1 root localhost mv etc yum.repos.d centos base.repo etc yum.repos.d cento...

linux修改yum源映象源

修改centos預設yum源為國內yum映象源 1 首先備份系統自帶yum源配置檔案 etc yum.repos.d centos base.repo 備份前建議先安裝wget,yum install wget root localhost mv etc yum.repos.d centos bas...

CentOS之yum映象源

1 首先備份系統自帶yum源配置檔案 etc yum.repos.d centos base.repo mv etc yum.repos.d centos base.repo etc yum.repos.d centos base.repo.backup2 進入yum源配置檔案所在的資料夾 cd e...