CentOS7 Local yum的一次报错信息

简介:

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

操作如下:

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

1
2
[root@localhost yum.repos.d] # mkdir -p /localyum
[root@localhost yum.repos.d] # mount /dev/cdrom /localyum

2)添加一个repo文件

1
2
3
4
5
6
7
[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软件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[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文件

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

5)重新安装下vsftpd软件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[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)配置光盘开机自动挂载

1
2
3
[root@localhost ~] # echo "/dev/cdrom /localyum iso9660 defaults  0 0">>/etc/fstab
[root@localhost ~] # mount -a
再次运行,yum -y  install  vsftpd,就没有类似的报错了









本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1892406,如需转载请自行联系原作者
目录
相关文章
|
1月前
|
缓存 Linux
CentOS-6的iso下载地址镜像yum源
通过上述步骤,您可以成功下载CentOS 6的ISO镜像文件,并配置适用于CentOS 6的YUM源。尽管CentOS 6已经停止更新,但使用这些镜像和YUM源配置,可以继续在需要的环境中使用和维护CentOS 6系统。
301 20
|
1月前
|
Linux
CentOs9 yum源出现404问题
CentOs9-stream yum源出现404问题
|
2月前
|
安全 网络安全
gbase8a centos8(kylinv10)加载报登录 ftp失败报错530 Login incorrect 排查过程及解决办法
centos8(kylinv10)加载报登录 ftp失败报错530 Login incorrect 排查过程及解决办法
|
2月前
|
缓存 Linux
解决CentOS 7停止更新后yum源失效问题【图文教程】
以上步骤完成后,你的 CentOS 7 系统就会使用阿里云的 yum 源,更换yum以后就可以正常使用啦。
1821 2
|
4月前
|
缓存 Linux 编译器
【C++】CentOS环境搭建-安装log4cplus日志组件包及报错解决方案
通过上述步骤,您应该能够在CentOS环境中成功安装并使用log4cplus日志组件。面对任何安装或使用过程中出现的问题,仔细检查错误信息,对照提供的解决方案进行调整,通常都能找到合适的解决之道。log4cplus的强大功能将为您的项目提供灵活、高效的日志管理方案,助力软件开发与维护。
134 0
|
4月前
|
Linux 虚拟化 开发者
一键将CentOs的yum源更换为国内阿里yum源
一键将CentOs的yum源更换为国内阿里yum源
6818 8
|
7天前
|
监控 Linux
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
42 13
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
|
3月前
|
存储 缓存 Linux
【Linux】另一种基于rpm安装yum的方式
通过本文的方法,您可以在离线环境中使用RPM包安装YUM并进行必要的配置。这种方法适用于无法直接访问互联网的服务器或需要严格控制软件源的环境。通过配置本地YUM仓库,确保了软件包的安装和更新可以顺利进行。希望本文能够为您在特定环境中部署YUM提供实用的指导。
366 0
|
4月前
|
Unix Linux Go
Linux 使用Yum安装Go和配置环境
Linux 使用Yum安装Go和配置环境
|
5月前
|
关系型数据库 MySQL Linux
Linux 安装 mysql【使用yum源进行安装】
这篇文章介绍了在Linux系统中使用yum源安装MySQL数据库的步骤,包括配置yum源、安装MySQL服务、启动服务以及修改root用户的默认密码。
Linux 安装 mysql【使用yum源进行安装】

热门文章

最新文章