centos7 升级php7 添加配置epel源 报错:Cannot retrieve metalink for repository: epel. Please verify its path and try again
文章来自:循序渐渐linux:基础知识 一书 7.3章LAMP服务器搭建 日常故障
centos上好多软件升级需要配置epel源 其中有一点小插曲 需要手动更改
1、很多时候,对PHP环境要求较新的版本,例如,PHP 7环境,如果通过源码编译、安装,将会非常麻烦。这里提供一种通过yum工具安装最新PHP 版本的方法。首先,需要在系统上安装一个扩展yum源,即epel源,
可从http://fedoraproject.org/wiki/EPEL 网站下载针对CentOS 7版本的epel文件,然后进行安装,操作过程如下。 网络上好多yum安装的我尝试好多次不成功报错 所以手动安装
[root@localhost ~]# wget \
>http://mirrors.neusoft.edu.cn/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
[root@localhost ~]# rpm -ivh epel-release-7-5.noarch.rpm
2、接着,还需要一个REMI源,这个yum源提供了最新的PHP版本的下载和安装,它的官方网站为http://rpms.famillecollet.com/。安装REMI源的过程如下。
[root@localhost ~]# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
[root@localhost ~]# wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
[root@localhost ~]# rpm -ivh remi-release-7.rpm
3、默认情况下,REMI是禁用的。要检查REMI源是否已经成功安装,可以执行如下命令。
[root@localhost ~]# yum repolist disabled | grep remi
!remi Les RPM de remi pour Enterprise Linux 7 - x86_64
remi-debuginfo/x86_64 Les RPM de remi pour Enterprise Linux 7 - x86_64 -
!remi-php55 Les RPM de remi de PHP 5.5 pour Enterprise Linux 7
remi-php55-debuginfo/x86_64 Les RPM de remi de PHP 5.5 pour Enterprise Linux 7
!remi-php56 Les RPM de remi de PHP 5.6 pour Enterprise Linux 7
remi-php56-debuginfo/x86_64 Les RPM de remi de PHP 5.6 pour Enterprise Linux 7
remi-test Les RPM de remi en test pour Enterprise Linux 7 -
remi-test-debuginfo/x86_64 Les RPM de remi en test pour Enterprise Linux 7 -
从输出可知,有三个REMI仓库,分别是remi、remi-php55和remi-php56。默认情况下,这三个REMI仓库都处于禁用状态,但是最好禁用REMI仓库,只有在需要的时候再启用,以防止多个yum源产生冲突。
从输出可知,有三个REMI仓库,分别是remi、remi-php55和remi-php56。默认情况下,这三个REMI仓库都处于禁用状态,但是最好禁用REMI仓库,只有在需要的时候再启用,以防止多个yum源产生冲突。
要搜索REMI仓库中是否有可用的包,可以执行如下命令。
[root@localhost ~]# yum --enablerepo=remi list php
或者
[root@localhost ~]# yum --enablerepo=remi-php72 list php
通过这种方式,就可以很方便地安装自己需要的PHP版本。例如,要安装PHP,7.2版本,执行如下命令即可。
[root@localhost ~]# yum --enablerepo=remi-php72 install php
通过这样方式,PHP很快就可以安装完成。
问题会出现在第一步、
需要安装epel源。
解决方法: 一句话:把/etc/yum.repos.d/epel.repo,文件第3行注释去掉,把第四行注释掉。具体如下:
打开/etc/yum.repos.d/epel.repo,将配置文件修改为如下即可 :
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
再清理源,重新安装
- yum clean all
- yum install -y 需要的包
如果还是不行,修改DNS,到/etc/resolv.conf下添加一下:
nameserver 8.8.8.8
search localdomain
然后重启network服务:service network restart
centos7 升级php7 添加配置epel源 报错:Cannot retrieve metalink for repository: epel. Please verify its path and try again的更多相关文章
- 安装Nginx报错“Cannot retrieve metalink for repository: epel. Please verify its path and try again”
CentOS 6.5中通过yum安装nginx报错. 搜了一下,很多都是修改某个配置文件的.但是在StackOverFlow的某个问题下,有人回答说修改配置文件并不是一个好的方法,虽然我采用了这个人的 ...
- yum报错: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
在Centos 5.x或6.x上安装RHEL EPEL Repo repository,资源库,源的意思.RHEL EPEL(Extra Packages for Enterprise Linux) ...
- 运行yum报错:Error: Cannot retrieve metalink for repository: epel. Please verify its path
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again 当我们安装第三方扩 ...
- 运行yum报错Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
今天给Centos通过rpm -Uvh装了个epel的扩展后,执行yum就开始报错: Error: Cannot retrieve metalink for repository: epel. Ple ...
- Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again 问题分析
Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again Loaded pl ...
- yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again
在CentOS 6.3 x86_64下安装php-mcrypt的时候出现了问题:Error: Cannot retrieve metalink for repository: epel. Please ...
- Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
虚拟机恢复快照后,使用yum安装软件,提示下面的信息,开始以为是yum源的问题或者DNS的问题,但是无果,最后再看一下服务器的时间,坑了,还原快照,时间变成以前的了. [root@localhost ...
- Cannot retrieve metalink for repository: epel 错误解决办法
centos下安装完EPEL源, 然后更新一下yum缓存, 如果发现这样的错误:Error: Cannot retrieve metalink for repository: epel. Please ...
- Cannot retrieve metalink for repository: epel. Please verify its path and try again
今天在测试环境使用yum安装,遇到一个问题: Error: Cannot retrieve metalink for repository: epel. Please verify its path ...
随机推荐
- CUDA 与 OpenGL 的互操作
CUDA 与 OpenGL 的互操作一般是使用CUDA生成数据,然后在OpenGL中渲染数据对应的图形.这两者的结合有两种方式: 1.使用OpenGL中的PBO(像素缓冲区对象).CUDA生成像素数据 ...
- matplotlib画3D图修改X,Y,Z,colorbar的刻度值
修改X,Y,Z轴的刻度值 from matplotlib.ticker import MultipleLocator,FuncFormatter from mpl_toolkits.mplot3d i ...
- Pwn-level3(x64)
题目地址 https://dn.jarvisoj.com/challengefiles/level3_x64.rar.8c74c402b190ac3fbef5a9ae540c40de 跟level3差 ...
- 卷积核filter和kernal的区别
在一堆介绍卷积的帖子中,这篇特别之处在于很萌的示例配色,令人眼前一亮,当然直观也是很直观滴,保证了能在昏昏欲睡见周公子前看完. https://towardsdatascience.com/types ...
- java程序:调用百度api进行情感分析
源码: package com.jeson.ceshi; import java.util.HashMap; import org.json.JSONObject; import com.baidu. ...
- bzoj2093 Frog
题目链接 思路 非常有趣的一道题. 先考虑如何找出第K远的位置. 因为给出的序列是单调的,所以对于位置\(i\)的前\(K\)远位置肯定是一个包含位置\(i\)的长度为\(k+1\)的区间.我们用\( ...
- [LOJ 6435][PKUSC 2018]星际穿越
[LOJ 6435][PKUSC 2018]星际穿越 题意 给定 \(n\) 个点, 每个点与 \([l_i,i-1]\) 之间的点建立有单位距离的双向边. \(q\) 组询问从 \(x\) 走到 \ ...
- centos配置ADSL拨号 配置阿里云的yum源
如果系统yum源有问题可以更改yum源配置阿里云的yum源1)下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo(没有 wget命令可 ...
- Jmockit 构造函数与初始代码块
from Jmockit 中文网 http://jmockit.cn/showArticle.htm?channel=4&id=14 有些编写不良好的类的构造函数,初始代码块,静态代码块存在大 ...
- CMPT 300 – Operating Systems
Assignment 4 – Create Simple YetFunctional File SystemCMPT 300 – Operating SystemsPlease submit a zi ...