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 22:28
下一篇 2016-07-16 22:28

相关推荐

  • 推荐-使用iptables作为网络防火墙构建安全的网络环境

    使用iptables作为网络防火墙构建安全的网络环境 使用iptables作为网络防火墙构建安全的网络环境 前言 网络防火墙的优势 实验拓扑图 实验环境 实验步骤 防火墙未设置前对所有服务器的测试 针对不同服务器进行”非法”访问 定义网络防火墙规则 再次针对不同服务器进行”非法”访问 测试服务器是否可访问 总结 前言 一般情况下iptables只作为主机防火…

    Linux干货 2016-03-31
  • 第十周作业

    第十周作业   1、CentOS系统启动流程: 1.加电自检:由bios去检测各硬件是否存在且是否正常运行,然后进行硬件初始化 2.选择启动顺序,加载mbr:根据bios设置的设备启动顺序,找到第一个安装有bootloader的设备进行启动,bootloader去识别加载操作系统中的核心文件,并提交到内存中运行,进而来启动相对应的操作系统 由于bootloa…

    Linux干货 2017-11-13
  • btrfs文件系统——更加高级的文件系统

    Btrfs 文件系统: Btrfs ( B-tree ,Butter FS ,Better FS ) GPL ,Oracle公司在2007年研发,支持CoW(对文件快照),为了取代ext3,ext4,xfs 核心特点:          多物理卷支持:btrfs可由多个底层物理卷…

    Linux干货 2016-08-31
  • Mariadb基于ssl的主从复制

    Mariadb基于ssl的主从复制 一、前言 备份数据库是生产环境中的首要任务,重中之重。一般配置中mariadb的主从传输是明文传输,但是有时候对一些特殊业务来说是不允许的,为了保证数据在传输过程中的安全性,因此使用基于SSL的复制会大大加强数据的安全性。 二、准备工作 1、实验系统环境: CentOS7.2,SELinux关闭,iptables关闭,安装…

    Linux干货 2017-02-24
  • tar、rpm和yum总结

    tar、rpm和yum总结 tar工具 tar是Tape ARchive的缩写,原意是磁带归档,进行数据备份。在linux中,用tar命令,可以把一大堆的文件和目录全部打包成一个文件,方便网络传输和备份数据。 tar不仅可以打包多个文件和目录,还可以对打包完的数据包进行压缩,进一步提升传输和备份质量。 选项 -c:设置新的备份文件-t:列出备份文件的内容 -…

    Linux干货 2017-08-04
  • 网络班第27期第二周作业

    1、 Linux上的文件管理类命令都有哪些,其常用的使用方法及其相关的实例演示。 cp命令:copy 文件à>目录 文件à>文件 目录->文件(报错)           目录->目录 常用选项:     &nbsp…

    2017-07-31