为centos7配置阿里yum源遇到的问题以及解决方法
【问题背景】
卸载安装的Ambari,之前都是因为卸载不干净。这次重写安装,卸载完之后,发现httpd无法启动,所以想卸载httpd进行重新安装,但是执行命令yum list | grep httpd报错。
【遇到的问题】
配置过程很简单,去https://opsx.alibaba.com/mirror 获得执行命令:

但是我在执行yum makecache时报错,报错信息如下:
Loaded plugins: fastestmirror, langpacks, priorities
Repository epel is listed more than once in the configuration
Cleaning repos: base epel extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@hadoop01 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, langpacks, priorities
Repository epel is listed more than once in the configuration
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
http://mirrors.aliyun.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article https://wiki.centos.org/yum-errors If above article doesn't help to resolve this issue please use https://bugs.centos.org/. http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/$releasever/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30000 milliseconds')
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error"
Trying other mirror.
http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/$releasever/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30001 milliseconds')
Trying other mirror.
http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/$releasever/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30001 milliseconds')
Trying other mirror.
http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/$releasever/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30001 milliseconds')
Trying other mirror.
http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/$releasever/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30001 milliseconds')
Trying other mirror.
http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/$releasever/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30001 milliseconds')
Trying other mirror.
...
【解决方法】
在网上找了好多帖子,都没能解决我的问题,后来看到是HTTP请求失败,尝试本地访问之前wget下来的 CentOS-Base.repo 发现其中的:
http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
等URL通过http的形式根本无法访问,此时将变量$releasever改为7(我的系统是centos 7),发现可以访问了,顺便将所有的变量$releasever都改为7。感觉这个变量$releasever根本就没起作用呀。
改完之后,执行yum clean all 以及 yum makecache 成功。
oaded plugins: fastestmirror, langpacks
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB ::
extras | 3.4 kB ::
updates | 3.4 kB ::
(/): base/x86_64/group_gz | kB ::
(/): base/x86_64/primary_db | 6.0 MB ::
(/): base/x86_64/filelists_db | 7.1 MB ::
(/): base/x86_64/other_db | 2.6 MB ::
(/): extras/x86_64/prestodelta | kB ::
(/): extras/x86_64/primary_db | kB ::
(/): extras/x86_64/other_db | kB ::
(/): extras/x86_64/filelists_db | kB ::
(/): updates/x86_64/prestodelta | kB ::
(/): updates/x86_64/filelists_db | 5.2 MB ::
(/): updates/x86_64/other_db | kB ::
(/): updates/x86_64/primary_db | 7.4 MB ::
Metadata Cache Created
为centos7配置阿里yum源遇到的问题以及解决方法的更多相关文章
- centos7配置阿里yum源
首先刚刚安装完的centos并不像Ubuntu系统那样有很多的源来可以供您使用 所以我们需要通过下载阿里云的yum源在下载epel-release.noarch扩展包就可以了 操作如下: 1.首先这是 ...
- 配置阿里yum源,设置命令
配置阿里yum源 #linux的软件包管理 安装 软件的方式有三种 .源代码编译安装() .下载python3的源代码 .解压缩源代码 .进入源代码目录,开始编译安装 .配置环境变量 .yum方式安装 ...
- CentOS7 配置163 yum源(详细步骤)
CentOS7 配置163 yum源 1)下载repo文件 wget http://mirrors.163.com/.help/CentOS7-Base-163.repo 2)备份并替换系统的r ...
- 虚拟机centos7配置本地yum源
在虚拟机中要使用yum命令,就要先配置一下yum源,下面就分享一下这个过程: 1. 挂载iso到vmware,首先得确保CD/DVD连接到镜像.可以这样操作 2. 执行下面的命令 # mkdir /m ...
- CentOS7使用阿里yum源安装Docker
yum install -y yum-utils device-mapper-persistent-data lvm2安装所需的包 # yum-config-manager --add-repo ht ...
- centos7配置国内yum源
文章目录 1.什么是yum仓库? 2.yum仓库配置 2.1.阿里镜像仓库配置 2.1.1.配置步骤 2.1.2.epel源 安装和配置 2.1.3.查看yum源 2.2.配置 清华大学镜像仓库 1. ...
- 详解centos7配置本地yum源的方法
近在使用虚拟机时遇到一些麻烦,因为公司内部有网络管理,所以vm连接不上外网,yum无法安装软件,怎么解决呢?–使用iso做本地yum源,可以解决大部份的包安装. vm安装的是centos7. 1.挂载 ...
- centos 7下配置阿里yum源
1.打开centos的yum文件夹 cd /etc/yum.repos.d/ 2.用wget下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7. ...
- CentOS7配置本地Yum源
从CentOS7官网下载DVD中存在需要的大部分软件,所以在没有网络的情况下可以配置yum源为本地的DVD,下载速度快,软件稳定.1. 如果使用虚拟机,那么就在虚拟机中挂载DVD的iso文件.2. 使 ...
随机推荐
- python路径相关处理
一.绝对路径 import os path1=os.path.abspath('.') #表示当前所处的文件夹的绝对路径 print(path1) path2=os.path.abspath('..' ...
- SAP Leonardo图片处理相关的机器学习服务在SAP智能服务场景中的应用
本文作为Jerry最近正在做的一个项目的工作思路的梳理. 我们假设这样一个服务场景,技师上门维修某设备,发现设备上某零件损坏了,假设这位技师由于种种原因,没能根据自己的经验识别出这个零件的型号.此时技 ...
- 【前端适配】vw单位移动端适配方案
近些年移动端的强势崛起,导致移动端适配越来越重要,个人之前一直使用的是rem进行适配,但是发现并不是非常完美,给力的是大漠老师写了一篇<如何在Vue项目中使用vw实现移动端适配>,比较完美 ...
- Python requests.post嵌套多层json参数调用接口
#coding:utf-8 import requests,json #第一行注解的#coding:utf-8表示可以支持中文,不然代码里面有中文会报错 url = "http://xxx& ...
- iptables详解(6):iptables扩展模块之 state 扩展
为了防止恶意攻击主动连接到你的主机 我们需要通过iptables的扩展模块判断报文是为了回应我们之前发出的报文还是主动向我们发送的报文 state模块可以让iptables实现 连接追踪机制 NEW表 ...
- 模仿DotnetCore中间件的方式,做一个列表过滤的功能
我们的很多功能当中都会遇到对版本进行过滤的场合,例如你可能需要对列表中的数据的时间进行过滤.版本过滤.渠道以及地区信息进行过滤. 原本的做法:设计很多个过滤方法,通过枚举的方式组合,选择需要过滤哪些方 ...
- 无法访问此网站 ERR_CONTENT_DECODING_FAILED
这个错误挺少见的. 百度了下: 1,说是文件编码格式不正确: 2,说是Nginx的压缩和tomcat的压缩冲突了,关闭gzip压缩: 3,……………… 不管是哪一种情况,都是编码问题,所以逐一排查,根 ...
- java基础(2)---基本语法
一.程序注释 二.HelloWorld 三.关键字 四.常量 五.变量 六.标识符: 七.数据类型 数据类型间的转换: (1)自主转换:不需要明确指出所要转化的类型是什么,而是由java虚拟机自动转化 ...
- Ubuntu增加swap交换空间的步骤
1.首先用命令free查看系统内 Swap 分区大小. free -m total used free shared buffers cached Mem: 2012 1960 51 0 748 95 ...
- php遍历目录与文件夹的多种方法详解
遍历目录或遍历目录下指定类型的文件,这是每一个童鞋在写程序的时候难免会用到的.PHP本身也提供了很多灰常有用的函数,正确地使用它们,不会有错滴.下面就我个人学习过程中的一些总结,希望对想学PHP的童鞋 ...