自从yum光盘挂载之后就用不了yum了

[复制链接]
查看11 | 回复4 | 2021-1-27 05:10:03 | 显示全部楼层 |阅读模式
[[email protected]]#yumlist
Loadedplugins:fastestmirror,langpacks
Determiningfastestmirrors
Couldnotretrievemirrorlisthttp://mirrorlist.centos.org/?release=7&arch=x86_64&repo=fasttrack&infra=stockerrorwas
14:curl#6-"Couldnotresolvehost:mirrorlist.centos.org;Unknownerror"

Oneoftheconfiguredrepositoriesfailed(Unknown),
andyumdoesn'thaveenoughcacheddatatocontinue.Atthispointtheonly
safethingyumcandoisfail.Thereareafewwaystowork"fix"this:
1.Contacttheupstreamfortherepositoryandgetthemtofixtheproblem.
2.Reconfigurethebaseurl/etc.fortherepository,topointtoaworking
upstream.Thisismostoftenusefulifyouareusinganewer
distributionreleasethanissupportedbytherepository(andthe
packagesforthepreviousdistributionreleasestillwork).
3.Runthecommandwiththerepositorytemporarilydisabled
yum--disablerepo=...
4.Disabletherepositorypermanently,soyumwon'tuseitbydefault.Yum
willthenjustignoretherepositoryuntilyoupermanentlyenableit
againoruse--enablerepofortemporaryusage:
yum-config-manager--disable
or
subscription-managerrepos--disable=
5.Configurethefailingrepositorytobeskipped,ifitisunavailable.
Notethatyumwilltrytocontacttherepo.whenitrunsmostcommands,
sowillhavetotryandfaileachtime(andthus.yumwillbebemuch
slower).Ifitisaverytemporaryproblemthough,thisisoftenanice
compromise:
yum-config-manager--save--setopt=.skip_if_unavailable=true
Cannotfindavalidbaseurlforrepo:fasttrack/7/x86_64
[[email protected]]#ls
CentOS-Base.repoCentOS-CR.repoCentOS-fasttrack.repoCentOS-Media.repoCentOS-Sources.repoCentOS-Vault.repo
[[email protected]]#ll
total28
-rw-r--r--.1rootroot276Apr1918:33CentOS-Base.repo
-rw-r--r--.1rootroot1309Sep52019CentOS-CR.repo
-rw-r--r--.1rootroot314Apr1915:30CentOS-fasttrack.repo
-rw-r--r--.1rootroot629Apr1918:36CentOS-Media.repo
-rw-r--r--.1rootroot1331Sep52019CentOS-Sources.repo
-rw-r--r--.1rootroot6639Sep52019CentOS-Vault.repo
[[email protected]]#
分 -->
回复

使用道具 举报

千问 | 2021-1-27 05:10:03 | 显示全部楼层
把你之前Yum光盘的那个文件删除或者移动到其他文件夹里清理yum缓存就可以了如果还不可以检查网络是否通的
回复

使用道具 举报

千问 | 2021-1-27 05:10:03 | 显示全部楼层
查看yum源的repo里面怎么写的,之前如果用的本地挂接镜像方式的话,查看是否有备份的repo文件,还有查看下光盘yum配置文件中的gpgcheck,enabled这两个参数和你正式启用的yum源中的参数,一般情况下,只要卸载掉原来光盘镜像,备份现在yum源,重新下载或者还原原来备份yum源就可以了

回复

使用道具 举报

千问 | 2021-1-27 05:10:03 | 显示全部楼层
我的环境是centos7
将cd中填入资源文件,然后参考如下,希望对你有帮助:
[root@mysql2~]#mkdir/mnt/cd
[root@mysql2~]#mount/dev/cdrom/mnt/cd
[root@mysql2~]#mv/etc/yum.repos.d/*.repo~
[root@mysql2~]#vi/etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///mnt/cd
gpgcheck=0
enable=1
[root@mysql2~]#yumrepolist
最后安装
回复

使用道具 举报

千问 | 2021-1-27 05:10:03 | 显示全部楼层
卸载掉原来的yum镜像,然后将/etc/yum.repos.d中的再用yum源备份或者改名,然后重新载入原yum源CentOS-Base.repo,yumcleanall
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行