设为首页 收藏本站
查看: 754|回复: 0

[经验分享] CentOS7 Local yum的一次报错信息

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-7-18 10:56:43 | 显示全部楼层 |阅读模式
说明:今天在火车上测试一个CentOS7下的一个服务,要用到yum配置,但是本机没有联网,所以考虑到配置本地yum,按照之前CentOS6下的常规方法,居然发现有报错。
操作如下:

1)虚拟机下将CentOS7光盘加载到系统里面,然后挂载到本地的/localyum上

1
[iyunv@localhost yum.repos.d]# mount /dev/cdrom /localyum



2)添加一个repo文件

1
2
3
4
5
6
7
[iyunv@localhost ~]# cd /etc/yum.repos.d/
[iyunv@localhost yum.repos.d]# vim CentOS7-local.repo
[localyum]
name=localyum
baseurl=file:///localyum/
gpgcheck=0
enabled=1



3)测试安装下vsftpd软件
[iyunv@localhost yum.repos.d]# yum -y install vsftpd

1
2
3
4
5
6
7
8
已加载插件:fastestmirror, langpacksCould not retrieve mirrorlist http://mirrorlist.centos.org/?re ... =os&infra=stock error was14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误" One of the configured repositories failed (未知), 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. Disable the repository, 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>
     4. 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 find a valid baseurl for repo: base/7/x86_64



4)由于是在局域网内,无法正常连上外网,所有重新调整了下repo文件

1
2
3
4
5
6
7
8
[iyunv@localhost yum.repos.d]# vim CentOS7-local.repo
[localyum]
name=localyum
baseurl=file:///localyum/
gpgcheck=0
enabled=1
yum --disablerepo=\* --enablerepo=localyum clean all #清除缓存
yum --disablerepo=\* --enablerepo=localyum makecache #缓存本地yum源包信息



5)重新安装下vsftpd软件
[iyunv@localhost yum.repos.d]# yum -y install vsftpd

1
2
3
4
5
6
7
已加载插件:fastestmirror, langpacksbase                                                                                                                         | 3.6 kB  00:00:00     extras                                                                                                                       | 3.4 kB  00:00:00     localyum                                                                                                                     | 3.6 kB  00:00:00     updates                                                                                                                      | 3.4 kB  00:00:00     (1/6): localyum/group_gz                                                                                                    | 154 kB  00:00:00     (2/6): localyum/primary_db                                                                                                   | 2.7 MB  00:00:00     (3/6): extras/7/x86_64/primary_db                                                                                            | 149 kB  00:00:00     (4/6): updates/7/x86_64/primary_db                                                                                           | 5.7 MB  00:00:18     (5/6): base/7/x86_64/group_gz                                                                                                | 155 kB  00:00:21     (6/6): base/7/x86_64/primary_db                                                                                              | 5.3 MB  00:00:29     Determining fastest mirrors * base: mirrors.163.com * extras: mirrors.cqu.edu.cn * updates: mirrors.cqu.edu.cn正在解决依赖关系--> 正在检查事务---> 软件包 vsftpd.x86_64.0.3.0.2-11.el7_2 将被 安装--> 解决依赖关系完成
依赖关系解决
==================================================================================================================================================== Package                          架构                             版本                                     源                                 大小====================================================================================================================================================正在安装: vsftpd                           x86_64                           3.0.2-11.el7_2                           updates                           167 k
事务概要====================================================================================================================================================安装  1 软件包
总下载量:167 k安装大小:347 kDownloading packages:vsftpd-3.0.2-11.el7_2.x86_64.rpm                                                                                             | 167 kB  00:00:00     Running transaction checkRunning transaction testTransaction test succeededRunning transaction  正在安装    : vsftpd-3.0.2-11.el7_2.x86_64                                                                                                    1/1   验证中      : vsftpd-3.0.2-11.el7_2.x86_64                                                                                                    1/1
已安装:  vsftpd.x86_64 0:3.0.2-11.el7_2                                                                                                                  
完毕!



6)配置光盘开机自动挂载

1
2
[iyunv@localhost ~]# echo "/dev/cdrom /localyum iso9660 defaults  0 0">>/etc/fstab
[iyunv@localhost ~]# mount -a



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-245786-1-1.html 上篇帖子: U盘给PC机装CentOS6.5报detecting hardware的解决办法 下篇帖子: Linux下检测程序的md5值异常自动报警的脚本 信息
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表