0

On an Amazon EC2 Linux server, I've run:

sudo su -
yum -y update
yum install -y php73

I receive the error No package php73 available.

I've been able to install httpd, php, & php-mysql okay.

Here is my yum repo list:

[root@ip-172-31-1-175 httpd]# yum repolist all
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                          | 2.4 kB  00:00:00     
amzn2extra-docker                                                   | 1.3 kB  00:00:00     
amzn2extra-php7.3                                                   | 1.8 kB  00:00:00     
(1/2): amzn2extra-php7.3/2/x86_64/updateinfo                        |   69 B  00:00:00     
(2/2): amzn2extra-php7.3/2/x86_64/primary_db                        | 256 kB  00:00:00     
repo id                              repo name                              status
amzn2-core/2/x86_64                  Amazon Linux 2 core repository         enabled: 18,631
amzn2-core-debuginfo/2/x86_64        Amazon Linux 2 core repository - debug disabled
amzn2-core-source/2                  Amazon Linux 2 core repository - sourc disabled
amzn2extra-docker/2/x86_64           Amazon Extras repo for docker          enabled:     19
amzn2extra-docker-debuginfo/2/x86_64 Amazon Extras debuginfo repo for docke disabled
amzn2extra-docker-source/2           Amazon Extras source repo for docker   disabled
amzn2extra-php7.3/2/x86_64           Amazon Extras repo for php7.3          enabled:    305
amzn2extra-php7.3-debuginfo/2/x86_64 Amazon Extras debuginfo repo for php7. disabled
amzn2extra-php7.3-source/2           Amazon Extras source repo for php7.3   disabled
repolist: 18,955

I've created /etc/yum.repos.d/amzn2-updates.repo, but when I run yum install php73, I receive the error:

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd Could not retrieve mirrorlist http://repo.ap-southeast-2.amazonaws.com/2/updates/mirror.list error was 14: HTTP Error 403 - Forbidden

One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: amzn-updates/2

This is my /etc/yum.repos.d/amzn2-updates.repo:

[amzn-updates]
name=amzn-updates-Base
mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list
mirrorlist_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=3
timeout=5
report_instanceid=yes

[amzn-updates-debuginfo]
name=amzn-updates-debuginfo
mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/debuginfo/mirror.list
mirrorlist_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=0
retries=3
timeout=5
report_instanceid=yes

[amzn-updates-source]
name=amzn-updates-source
mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/SRPMS/mirror.list
mirrorlist_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=0
retries=3
timeout=5
report_instanceid=yes

Help appreciated.

  • Are you on Amazon Linux 1 or 2? – Tim Mar 1 at 7:55
  • Amazon Linux 2 AMI, @Tim. – Steve Mar 1 at 11:17
  • The repo I sent you is for Amazon Linux 1, so perhaps use caution with AL2. – Tim Mar 1 at 18:11
0

When I run the install on Amazon Linux v1 here's what I see

sudo yum install php73
Loaded plugins: update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package php73.x86_64 0:7.3.14-1.23.amzn1 will be installed
--> Processing Dependency: php73-common(x86-64) = 7.3.14-1.23.amzn1 for package: php73-7.3.14-1.23.amzn1.x86_64
--> Processing Dependency: php73-cli(x86-64) = 7.3.14-1.23.amzn1 for package: php73-7.3.14-1.23.amzn1.x86_64
--> Processing Dependency: php73-common for package: php73-7.3.14-1.23.amzn1.x86_64
--> Running transaction check
---> Package php73-cli.x86_64 0:7.3.14-1.23.amzn1 will be installed
---> Package php73-common.x86_64 0:7.3.14-1.23.amzn1 will be installed
--> Processing Dependency: php73-xml(x86-64) = 7.3.14-1.23.amzn1 for package: php73-common-7.3.14-1.23.amzn1.x86_64
--> Processing Dependency: php73-process(x86-64) = 7.3.14-1.23.amzn1 for package: php73-common-7.3.14-1.23.amzn1.x86_64
--> Processing Dependency: php73-json(x86-64) for package: php73-common-7.3.14-1.23.amzn1.x86_64
--> Running transaction check
---> Package php73-json.x86_64 0:7.3.14-1.23.amzn1 will be installed
---> Package php73-process.x86_64 0:7.3.14-1.23.amzn1 will be installed
---> Package php73-xml.x86_64 0:7.3.14-1.23.amzn1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================
 Package                   Arch               Version                         Repository                Size
=============================================================================================================
Installing:
 php73                     x86_64             7.3.14-1.23.amzn1               amzn-updates             3.6 M
Installing for dependencies:
 php73-cli                 x86_64             7.3.14-1.23.amzn1               amzn-updates             5.1 M
 php73-common              x86_64             7.3.14-1.23.amzn1               amzn-updates             1.4 M
 php73-json                x86_64             7.3.14-1.23.amzn1               amzn-updates              82 k
 php73-process             x86_64             7.3.14-1.23.amzn1               amzn-updates              95 k
 php73-xml                 x86_64             7.3.14-1.23.amzn1               amzn-updates             322 k

Transaction Summary
=============================================================================================================
Install  1 Package (+5 Dependent packages)

Total download size: 11 M
Installed size: 36 M
Is this ok [y/d/N]: n
Exiting on user command
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2020-02-28.20-47.yUTifC.yumtx

Here's the yum repo's I have available

> yum repolist all
Loaded plugins: update-motd, upgrade-helper
repo id                                 repo name                                            status
amzn-main/latest                        amzn-main-Base                                       enabled: 5,933+1
amzn-main-debuginfo/latest              amzn-main-debuginfo                                  disabled
amzn-main-source/latest                 amzn-main-source                                     disabled
!amzn-nosrc/latest                      amzn-nosrc-Base                                      disabled
!amzn-preview/latest                    amzn-preview-Base                                    disabled
amzn-preview-debuginfo/latest           amzn-preview-debuginfo                               disabled
amzn-preview-source/latest              amzn-preview-source                                  disabled
amzn-updates/latest                     amzn-updates-Base                                    enabled: 3,774+2
amzn-updates-debuginfo/latest           amzn-updates-debuginfo                               disabled
amzn-updates-source/latest              amzn-updates-source                                  disabled
!copart-restic/x86_64                   Copr repo for restic owned by copart                 disabled
!devopsx-amazon/x86_64                  DevopsX packages for Amazon Linux - x86_64           disabled
!download.mono-project.com_repo_centos_ added from: http://download.mono-project.com/repo/ce disabled
!epel/x86_64                            Extra Packages for Enterprise Linux 6 - x86_64       disabled
epel-debuginfo/x86_64                   Extra Packages for Enterprise Linux 6 - x86_64 - Deb enabled:   2,958
epel-source/x86_64                      Extra Packages for Enterprise Linux 6 - x86_64 - Sou enabled:       0
epel-testing/x86_64                     Extra Packages for Enterprise Linux 6 - Testing - x8 disabled
epel-testing-debuginfo/x86_64           Extra Packages for Enterprise Linux 6 - Testing - x8 disabled
epel-testing-source/x86_64              Extra Packages for Enterprise Linux 6 - Testing - x8 disabled
repolist: 12,665

I wonder if you have the correct repo enabled. If this doesn't help please edit your question to show your repo list with "yum repolist all".

If you need the Amazon Updates repo, try adding this to the file /etc/yum.repos.d/amzn-updates.repo

[amzn-updates]
name=amzn-updates-Base
mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list
mirrorlist_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=3
timeout=5
report_instanceid=yes

[amzn-updates-debuginfo]
name=amzn-updates-debuginfo
mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/debuginfo/mirror.list
mirrorlist_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=0
retries=3
timeout=5
report_instanceid=yes

[amzn-updates-source]
name=amzn-updates-source
mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/SRPMS/mirror.list
mirrorlist_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=0
retries=3
timeout=5
report_instanceid=yes
| improve this answer | |
  • Thanks Tim, I've added my repo list to the question. – Steve Feb 28 at 8:21
  • I guess you either need to add the repo (I've copied the details above) or work out if you have a disabled repo that has the same software. You could also maybe find and add the PHP 7.3 repo maintained by whoever makes PHP. – Tim Feb 28 at 18:49
  • Thanks again. I've created amzn2-updates.repo (to match the format of amzn2-core.repo & amzn2-extras.repo, but receive a different error now (added to my question). – Steve Mar 1 at 6:09
  • hi Steve what is the result for php -v ? – Aravinda Mar 1 at 7:05
  • Weird, @Aravinda, I see PHP 7.3.14 returned. – Steve Mar 1 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.