Couldn't open file /mnt/iso/repodata/repomd.xml


 

 經判斷是yum源的問題,如何才能修復?

方式一:使用國內的阿里雲鏡像

(1)把/etc/yum.repos.d/下面所有的源給刪除掉了

(2)下載鏡像

# CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
 

注意如果沒有安裝wget,可以從下面的網址中先手動下載,然后上傳到linux上安裝:http://www.rpmfind.net/linux/rpm2html/search.php?query=wget

(3)執行命令,重新生成cache

yum clean all
yum makecache

方式二:使用官網的鏡像

(1)把/etc/yum.repos.d/下面所有的源給刪除掉了

(2)執行下面的命令,重新生成鏡像

//執行這個命令之后
rpm -Uvh --force http://mirror.centos.org/centos-7/7/os/x86_64/Packages/centos-release-7-9.2009.0.el7.centos.x86_64.rpm

(3)查看/etc/yum.repos.d/下面目錄,就會發現鏡像已經安裝完畢:

-rw-r--r--. 1 root root 1664 8月  30 23:53 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 8月  30 23:53 CentOS-CR.repo
-rw-r--r--. 1 root root  649 8月  30 23:53 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  314 8月  30 23:53 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 8月  30 23:53 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 8月  30 23:53 CentOS-Sources.repo
-rw-r--r--. 1 root root 3830 8月  30 23:53 CentOS-Vault.repo
 

(4)生成緩存

yum clean all
yum makecache

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM