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 ...
随机推荐
- hdu-5742 It's All In The Mind(数学)
题目链接: It's All In The Mind Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (J ...
- Windows下Tesseract4.0识别与中文手写字体训练
一 . tesseract 4.0 安装及使用 1. tesseract 4.0 安装 安装包下载地址: http://digi.bib.uni-mannheim.de/tesseract/tesse ...
- bzoj 2194 快速傅立叶之二 —— FFT
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2194 如果把 a 序列翻转,则卷积得到的是 c[n-i],再把得到的 c 序列翻转即可. 代 ...
- 转 vs2008使用技巧推荐
Visual Studio 2008自带的1000多个 Windows 系统使用的各种图标.光标和动画文件在Visual Studio 2008的安装目录下,\Microsoft Visual Stu ...
- 1.7 hive基本操作
一.基本命令和设置 1.命令 [root@hadoop-senior hive-0.13.1]# bin/hive Logging initialized using configuration in ...
- 【网络爬虫】【java】微博爬虫(四):数据处理——jsoup工具解析html、dom4j读写xml
之前提到过,对于简单的网页结构解析,可以直接通过观察法.手工写正则解析,可以做出来,比如网易微博.但是对于结构稍微复杂点的,比如新浪微博,如果还用正则,用眼睛一个个去找,未免太麻烦了. 本文介绍两个工 ...
- git常见错误及解决方案总结
git常见错误及解决方案总结 使用git在本地创建一个项目的过程 $ makdir ~/hello-world //创建一个项目hello- ...
- awk用法总结
简介 awk的命名来自于他的三位创始人Alfred Aho .Peter Weinberger 和 Brian Kernighan 的姓氏的首字母. 有多种版本:New awk(nawk),GNU a ...
- Java判断一个数是不是快乐数
快乐数的定义: 快乐数(happy number)有以下的特性: 在给定的进位制下,该数字所有数位(digits)的平方和,得到的新数再次求所有数位的平方和,如此重复进行,最终结果必为1. 以十进制为 ...
- E20180608-hm
更新: 2019/02/19 原来忘记分类,把此博文归入单词类 capacity n. 容量; 性能; 才能; 生产能力;