centos7 upgrade php7 add configuration epel source error: Can not retrieve metalink for repository:. epel Please verify its path and try again

Article from: Sequential gradually linux: basic knowledge of a book chapter 7.3 LAMP server set up a routine failure

Centos on a lot of software upgrades need to configure epel source where there is little need to manually change episode

1, a lot of time on the PHP environment requires a newer version, for example, PHP 7 environment, if the source code compiled by the installation will be very troublesome. There is provided a method to install the latest version of PHP through yum utility. First, the system needs to be installed on an extended source yum, i.e. epel source,

From http://fedoraproject.org/wiki/EPEL download site for CentOS 7 epel version of the file, and then install operation is as follows. Yum install the network lot I tried many times unsuccessfully so manually install error

    [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, then, you also need a source REMI, the yum source provides the latest version of PHP download and install, its official website is http://rpms.famillecollet.com/. REMI source installation procedure is as follows.

    [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, by default, REMI is disabled. To check whether REMI Source has been successfully installed, you can execute the following command.

    [root @ localhost ~] # yum repolist disabled | grep Remi 
    Remi RPM remi for Enterprise Linux 7 - x86_64 
remi-debuginfo / x86_64 RPM remi for Enterprise Linux 7 - x86_64 - ! remi-php55 RPM remi PHP 5.5 for Enterprise Linux 7 remi-php55-debuginfo / x86_64 RPM remi PHP 5.5 for Enterprise Linux 7
! remi-php56 RPM remi PHP 5.6 for Enterprise Linux 7 remi-php56-debuginfo / x86_64 PHP remi RPM 5.6 for Enterprise Linux 7 remi-test The RPM remi test for Enterprise Linux 7 -
remi-test-debuginfo / x86_64 RPM remi test for Enterprise Linux 7 -

Seen from the output, there are three REMI warehouses are remi, remi-php55 and remi-php56. By default, these three REMI warehouses are disabled, but it is best to disable REMI warehouse, and then only enabled when needed to prevent multiple yum source of conflict.

Seen from the output, there are three REMI warehouses are remi, remi-php55 and remi-php56. By default, these three REMI warehouses are disabled, but it is best to disable REMI warehouse, and then only enabled when needed to prevent multiple yum source of conflict.

To search for available packages REMI repository, execute the following command.

    [root@localhost ~]# yum --enablerepo=remi list php

or

    [root@localhost ~]# yum --enablerepo=remi-php72 list php

In this way, it can be easily installed PHP version they need. For example, to install PHP, 7.2 version, execute the following command.

    [root@localhost ~]# yum --enablerepo=remi-php72 install php

By this way, PHP will soon be installed.

 

The problem occurs in the first step,

You need to install epel source.

Solution: word: the /etc/yum.repos.d/epel.repo, the third line comment to remove the file, comment out the fourth line. details as follows:

Open /etc/yum.repos.d/epel.repo, will modify the configuration file can be as follows:

[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

[warm-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 = warm-debug-7 & arch = $ basearch
failovermethod = priority
enabled = 0
gpgkey = file: /// etc / PKI / rpm-gpg / rPM-gPG-KEY-mild-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

And then clean up the source, re-install

  1. yum clean all
  2. yum install -y required packages

If that does not work, modify DNS, add it to the next /etc/resolv.conf:

nameserver 8.8.8.8
search localdomain

Then restart the network service: service network restart

Guess you like

Origin www.cnblogs.com/wkvip/p/11470578.html