【问题背景】

卸载安装的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源遇到的问题以及解决方法的更多相关文章

  1. centos7配置阿里yum源

    首先刚刚安装完的centos并不像Ubuntu系统那样有很多的源来可以供您使用 所以我们需要通过下载阿里云的yum源在下载epel-release.noarch扩展包就可以了 操作如下: 1.首先这是 ...

  2. 配置阿里yum源,设置命令

    配置阿里yum源 #linux的软件包管理 安装 软件的方式有三种 .源代码编译安装() .下载python3的源代码 .解压缩源代码 .进入源代码目录,开始编译安装 .配置环境变量 .yum方式安装 ...

  3. CentOS7 配置163 yum源(详细步骤)

    CentOS7 配置163 yum源 1)下载repo文件  wget http://mirrors.163.com/.help/CentOS7-Base-163.repo   2)备份并替换系统的r ...

  4. 虚拟机centos7配置本地yum源

    在虚拟机中要使用yum命令,就要先配置一下yum源,下面就分享一下这个过程: 1. 挂载iso到vmware,首先得确保CD/DVD连接到镜像.可以这样操作 2. 执行下面的命令 # mkdir /m ...

  5. CentOS7使用阿里yum源安装Docker

    yum install -y yum-utils device-mapper-persistent-data lvm2安装所需的包 # yum-config-manager --add-repo ht ...

  6. centos7配置国内yum源

    文章目录 1.什么是yum仓库? 2.yum仓库配置 2.1.阿里镜像仓库配置 2.1.1.配置步骤 2.1.2.epel源 安装和配置 2.1.3.查看yum源 2.2.配置 清华大学镜像仓库 1. ...

  7. 详解centos7配置本地yum源的方法

    近在使用虚拟机时遇到一些麻烦,因为公司内部有网络管理,所以vm连接不上外网,yum无法安装软件,怎么解决呢?–使用iso做本地yum源,可以解决大部份的包安装. vm安装的是centos7. 1.挂载 ...

  8. centos 7下配置阿里yum源

    1.打开centos的yum文件夹 cd /etc/yum.repos.d/ 2.用wget下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7. ...

  9. CentOS7配置本地Yum源

    从CentOS7官网下载DVD中存在需要的大部分软件,所以在没有网络的情况下可以配置yum源为本地的DVD,下载速度快,软件稳定.1. 如果使用虚拟机,那么就在虚拟机中挂载DVD的iso文件.2. 使 ...

随机推荐

  1. django.http.request中QueryDict 对象

    在一个 HttpRequest 对象中, GET 和 POST 属性都是 django.http.QueryDict 的实例. QueryDict 是一个类似于字典的类,专门用来处理用一个键的多值.当 ...

  2. Java 之 OutputStreamReader类

    OutputStreamReader类 1.概述 转换流 java.io.OutputStreamReader ,是Writer的子类,是从字符流到字节流的桥梁. 它使用指定的字符集将字符编码为字节. ...

  3. stm32 FSMC-TFTLCD显示

    TFTLCD TFT液晶屏常用的通信模式主要有6800模式和8080模式,对于TFT彩屏通常都使用8080并口(简称80并口)模式 8080模式的读写时序其实跟LCD1602或者LCD12864的读写 ...

  4. 【leetcode】366.Find Leaves of Binary Tree

    原题 Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all lea ...

  5. 浅谈sqoop

    1.sqoop的概述a.sqoop 是一款工具,是appche 旗下的一款工具,主要是负责 hadoop与RDBMS之间的数据迁移,即从hadoop 文件系统 导出数据到RDBMS,从RDBMS导入数 ...

  6. linux内核构造skb发包-----raw、tcp网络编程

    1. 内核raw发包 #include <linux/init.h>#include <linux/module.h> #include <linux/kernel.h& ...

  7. SOUL软件小结

    soul 基于心灵的智能社交APP.功能是寻找最适合自己的灵魂伴侣 基于心灵测试给你智能匹配最简单的社交关系 匿名聊天软件一般都是没有机器人的,机器人一般不能对点聊很长时间 用户来源与动机 用户引流来 ...

  8. Django:ContentType组件

    一.项目背景 二.版本一 三.版本二 三.终极版(使用ContentType) 一.项目背景 luffy项目,有课程有学位课(不同的课程字段不一样),价格策略 问题:1.如何设计表结构,来表示这种规则 ...

  9. python中redis

    一.简介 二.redis的安装和使用 三.python操作readis之安装和支持存储类型 四.python操作redis值普通链接 五.python操作redis值连接池 六.操作之String操作 ...

  10. attr方法笔记(反射)

    attr方法笔记 attr中用到了四个内置面向对象方法(__getattr__,__setattr__,__hasattr__,__delattr__),这称为反射,由于python中一切皆对象,反射 ...