CentOS7 Local yum的一次报错信息

说明:今天在火车上测试一个CentOS7下的一个服务,要用到yum配置,但是本机没有联网,所以考虑到配置本地yum,按照之前CentOS6下的常规方法,居然发现有报错。

操作如下:

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

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

2)添加一个repo文件

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim CentOS7-local.repo 
[localyum]
name=localyum
baseurl=file:///localyum/
gpgcheck=0
enabled=1

3)测试安装下vsftpd软件

[root@localhost yum.repos.d]# yum -y install vsftpd
已加载插件:fastestmirror, langpacks
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: 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文件

[root@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软件

[root@localhost yum.repos.d]# yum -y install vsftpd
已加载插件:fastestmirror, langpacks
base                                                                                                                         | 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 k
Downloading packages:
vsftpd-3.0.2-11.el7_2.x86_64.rpm                                                                                             | 167 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running 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)配置光盘开机自动挂载

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

原创文章,作者:Net21-冰冻vs西瓜,如若转载,请注明出处:http://www.178linux.com/24291

(3)
Net21-冰冻vs西瓜Net21-冰冻vs西瓜
上一篇 2016-07-16
下一篇 2016-07-16

相关推荐

  • 设计模式(十一)代理模式Proxy(结构型)

    1.概述        因为某个对象消耗太多资源,而且你的代码并不是每个逻辑路径都需要此对象, 你曾有过延迟创建对象的想法吗 ( if和else就是不同的两条逻辑路径) ? 你有想过限制访问某个对象,也就是说,提供一组方法给普通用户,特别方法给管理员用户?以上两种需求都非常类似,并且都需要解决一个更大的问题:你如何提供…

    Linux干货 2015-07-09
  • Shell脚本编程之入门基础(二)if、case的使用

    Shell编程之条件选择和条件判断   一、条件选择(if)与条件判断(case)的对比: if语句:是选择执行,if语句可嵌套。 if条件选择使用格式 单分支 双分支 多分支 if 判断条件;then 条件为真的分支代码 fi if 判断条件; then 条件为真的分支代码 else 条件为假的分支代码 fi if CONDITION1; the…

    Linux干货 2016-08-15
  • DHCP

        动态主机设置协议(Dynamic Host Configuration Protocol,DHCP)是一个局域网的网络协议,使用UDP协议工作,主要有两个用途: 用于内部网络或网络服务供应商自动分配IP地址给用户 用于内部网络管理员作为对所有电脑作中央管理的手段     …

    Linux干货 2017-07-24
  • Linux中的网络功能概念介绍(一)

      在操作系统中,进程之间的通信是用ipc(内存基本通信)以及内存共享shm来实现本地的通信,那么如果跨主机间通信或者说是不同之间的主机用rpc(远程过程调用)以及socket套接字,用一个主机在socket中写数据,另一个主机在socket之间读数据,以实现进程通信的最终目的。   在网络功能出现之前,基本都是用电话…

    Linux干货 2016-11-23
  • 3.26第一篇博客

    1.安装VNC viewer (VNC是一款远程控制软件,即便版本不一样也可以互通) 安装好后,进入界面,可以直接在上方数据栏里输入服务器端的主机名或IP地址,即可建立连接。 二.安装VMware (VMware是一款可以控制和管理虚拟化的IT环境 可以跑各种的操作系统) 1.首先在内网ftp://172.16.0.1/pub/tools找到VMware版本…

    2018-03-26
  • 配置使用基于mysql存储rsyslog日志信息

    配置使用基于mysql存储rsyslog日志信息   日志对于我们来说,肯定不会陌生。每个系统应用,只要有人访问,每时每刻都会产生大量的日志,用来记录服务器应用的运行信息。以便于我们在服务有异常时进行查看,或是从日志记录中提取出应用系统的运行信息。某些电商Web网站甚至会利用日志记录去对用户的购买行为作分析,以便更好的服务于客户。 &nb…

    Linux干货 2016-09-05