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 ...
随机推荐
- react的路由权限控制
在使用路由的时候,有的时候我们的界面只能够在登录之后才可以看的到,这个时候就需要使用路由权限控制了 找了资料发现一个就是我使用的方法,一个是高阶组件. 原谅菜鸟看不太懂不会使用高阶组件………… 首先在 ...
- python27期python连接数据库:
import pymysql创建connectinon对象:con = pymysql.connect(host = "localhost",user = "root&q ...
- vmvare虚拟机篇
新建虚拟机-典型-稍后安装-Linux-管理-从磁盘删除-虚拟机名称-位置- 安装Tools-用于虚拟机和本地文件共享和传送 网络适配器桥接模式-桥接本地网卡 NAT模式-再重新连接本地网卡 仅主机模 ...
- springboot项目jar包运行
springboot项目jar包运行 参考 Linux后台运行java的jar包 步骤 进入maven项目中,打包项目. mvn package -Dmaven.test.skip=true 运行ja ...
- Open3D-PointNet2-Semantic3D-master的运行
1.修改download_semantic3d.sh文件 #!/bin/bash ans=`dpkg-query -W p7zip-full` if [ -z "$ans" ]; ...
- FFT_应用和例题
卷积 现有两个定义在 N 上的函数 \(f(n),g(n)\),定义 \(f\) 和 \(g\) 的卷积(convolution)为 \(f \otimes g\) \[ (f \otimes g)( ...
- golang实战--家庭收支记账软件(面向对象)
首先是具体的目录结构: 其中myAccount.go中调用utils包中的函数:utils.go实现记账软件的一些相应的功能: myAccount.go package main import ( & ...
- strpbrk(), strcasecmp(), strspn()
Linux字符比较函数: strpbrk() strcasecmp() strspn() #if _MSC_VER #define strcasecmp _stricmp //strcasecmp 找 ...
- LeetCode 394:字符串解码 Decode String
题目: 给定一个经过编码的字符串,返回它解码后的字符串. Given an encoded string, return its decoded string. 编码规则为: k[encoded_st ...
- Mybatis中的association用法
这篇文章我们将来学习一些 association 用法 表结构 DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `id` int(1 ...