yum localinstall 遇到的问题
[root@bogon base]# yum localinstall -y gcc-4.8.5-39.el7.x86_64.rpm 
Loaded plugins: fastestmirror
Examining gcc-4.8.5-39.el7.x86_64.rpm: gcc-4.8.5-39.el7.x86_64
Marking gcc-4.8.5-39.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-39.el7 will be installed
--> Processing Dependency: cpp = 4.8.5-39.el7 for package: gcc-4.8.5-39.el7.x86_64
Loading mirror speeds from cached hostfile


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

2个回答

yum源不对,可以找一个国内的yum源,例如阿里,163,等等

qq_25868251
予挚之 不是,只是我没有外网,在没有使用yum clean all 之前,这条命令是可以安装的,使用之后就提示这个问题了
8 个月之前 回复

没有外网的话,可以把你的centos光盘挂载到系统上,然后用本地光盘做yum源试试。

qq_25868251
予挚之 同样没有光盘的情况呢?我是本地有所有的rpm安装包,就是不想强制安装和一个一个慢慢安装,我记得yum localinstall 本地包的时候能自行解决他们之间的依赖关系
8 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问