CentOS7.2 yum安装报错
1、yum源repodata配置文件repomd.xml无法找到:
Couldn't open file /mnt/cdrom/repodata/repomd.xml

先找到repomd.xml的路径
find / -type f -name "repomd.xml"

我们看到路径是:/mnt
而报错的路径是:/mnt/cdrom
查看挂载点有mnt,故,我们需要找到这个路径,将 /mnt/cdrom修改为/mnt

去配置repodata/repomd.xml路径
cd /etc/yum.repos.d/

vi CentOS-Media.repo

将路径改成我们找到的路径:将 /mnt/cdrom修改为/mnt

保存并执行yum源
yum clean all
yum makecache
测试:用yum成功安装telnet:
yum install telnet

2、yum源没有配置repodata仓库:
Error downloading packages:
iptables-1.4.21-16.el7.i686: [Errno 256] No more mirrors to try.
libmnl-1.0.3-7.el7.i686: [Errno 256] No more mirrors to try.
libnetfilter_conntrack-1.0.4-2.el7.i686: [Errno 256] No more mirrors to try.
libnfnetlink-1.0.1-4.el7.i686: [Errno 256] No more mirrors to try.

测试查询原因
yum list
df -h

报错的路径是:/mnt/cdrom
df -h没有找到/mnt
我们可以直接线上搭建一个仓库,所以前提条件是要连接上百度,这里就引申出第3个问题:
3、无法连接百度,无法解析域名
ping: unknown host www.baidu.com
ping www.baidu.com

host www.baidu.com

针对无法连接百度,我目前遇到有两种:
1)有DNS:给 /etc/resolv.conf 添加上 nameserver=xxx.xxx.xxx.xxx(DNS码)
cat /etc/sysconfig/network-scripts/ifcfg-enxxxx
vi /etc/resolv.conf

2)无DNS:给 /etc/resolv.conf 添加上 nameserver=8.8.8.8(DNS码)
nameserver=8.8.8.8
测试:
第一步:备份你的原镜像文件,以免出错后可以恢复。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/
查看:
curl -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
下载:
wget-O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
CentOS7.2 yum安装报错的更多相关文章
- linux -小记(2)问题:yum 安装报错"Another app is currently holding the yum lock; waiting for it to exit... ...: yum Memory : 26 M RSS (868 MB VSZ) Started: Wed Oct 26 22:48:24 2016 - 0"
yum 安装报错 "Another app is currently holding the yum lock; waiting for it to exit... The other ap ...
- yum安装报错有冲突file /usr/lib64/php/modules/fileinfo.so conflicts between
yum安装报错有冲突file /usr/lib64/php/modules/fileinfo.so conflicts between attempted installs of php-pecl-f ...
- 树莓派(Raspberry Pi 3) centos7使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:
使用yum命令报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid ...
- Centos7最小化安装报错There are no enabled repos. Run "yum repolist all" to see the repos you have.解决办法
原因是缺少CentOS-Base.repo文件,因为我这台机器wget也不能用,所以我是下载到本地sftp上去的,传输的时候一定要在root用户下,否则会无法启动传输 这是报错的完整信息:Loadin ...
- 使用yum安装报错:[Errno 256] No more mirrors to try
背景:我使用yum方式安装软件时,比如zabbix这种软件,我们在安装时一般都是直接到zabbix官网,按照官方的步骤进行安装,但是有一个问题,官方的服务器不在国内,时常会在安装时导致超时报错.此时解 ...
- 故障小记录:yum 安装报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:
发生原因: 由于yum是基于python的,之前安装我python3,当我修改了python命令的指向到python3之后就会发生这样的问题. 解决办法: 由于我当初想到可能以后还需要python2, ...
- yum安装报错:Failure when receiving data from the peer
系统:Centos6.9 操作:yum install -y *.rpm 报错信息: Transaction Summary ===================================== ...
- yum 安装报错:*epel: mirrors.aliyun.comError: xzcompressionnot available
环境背景:epel源下载地址: http://mirrors.aliyun.com/Centos内核内核版本[root@nfs01 ~]# uname -r2.6.32-642.el6.x86_64= ...
- CentOS release 6.5 yum安装报错
单独安装如下任何一个包都会报依赖错误,需要一起安装才可以 rpm -ivh yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm yum-3.2.29-4 ...
随机推荐
- 未知USB设备 端口重置失败
1.开启手机中USB调试 进入“设置”->“应用程序”->“开发”勾选“USB调试程序”.这样设备才可以通过USB连线时被PC识别到. 2.安装驱动 要将Android手机连接到PC需要安 ...
- druid.io 海量实时OLAP数据仓库 (翻译+总结) (1)——分析框架如hive或者redshift(MPPDB)、ES等
介绍 我是NDPmedia公司的大数据OLAP的资深高级工程师, 专注于OLAP领域, 现将一个成熟的可靠的高性能的海量实时OLAP数据仓库介绍给大家: druid.io NDPmedia在2014年 ...
- CISCO-从TFTP上上传/下载配置文件
1.下载配置文件到TFTP服务器: 2.上传配置文件到路由器
- python中类的定义方法
# coding =utf-8 ## 类的定义 ##-------------------------------------------------- class Employee: empCoun ...
- FTP:文件传输协议(指令及响应代码)
文件传输协议(FTP)使得主机间可以共享文件. FTP 使用 TCP 生成一个虚拟连接用于控制信息,然后再生成一个单独的 TCP 连接用于数据传输.控制连接使用类似 TELNET 协议在主机间交换命令 ...
- kafka之二:Kafka 设计与原理详解
一.Kafka简介 本文综合了我之前写的kafka相关文章,可作为一个全面了解学习kafka的培训学习资料. 转载请注明出处 : 本文链接 1.1 背景历史 当今社会各种应用系统诸如商业.社交.搜索. ...
- Android开发—— 传递数据
一:使用静态变量传递数据 (1)静态变量传递数据,在目标Activity中声明静态变量,然后使用setText()方法将静态变量的值导出即可: (2)静态变量传递数据,在主Activity中对目标Ac ...
- 总结open与fopen的区别
https://www.zybuluo.com/yiltoncent/note/87461 参考链接1 参考链接2 对于这两个名字很类似的函数,对于很多初学者来说,不容易搞清楚它们有什么不同,只知道按 ...
- 安装mosquitto报缺少dll文件的错误
解决:下载缺少的dll组件,放到安装目录. 报错:The procedure entry point CRYPTO_memcmp could not be located in the dynami ...
- python 之生产者消费者模型
进程实现: import time,random from multiprocessing import Process,Queue def producer(name,q): count= 0 wh ...