8

I'm actually setting up my vagrant vm (trusty-64, Ubuntu distribution v14.04) and encountered an issue during the installation of all ppa:ondrej/php packages.

I tried the default way to install php...

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install php7.3

But it still has this issue:

E: Unable to locate package php7.3
E: Couldn't find any package by regex 'php7.3'

It seems he's ignoring the added repository (it's not listed in apt-get update) but the command seems fine:

gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

Actually, i have no clue whats wrong. Maybe someone has an idea and can explain it? Thanks a lot.

UPDATE:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.6 LTS
Release:        14.04
Codename:       trusty

used ubuntu/trusty64 vagrant box

It's the most common vagrant box with few well predefined settings.

source.list

/etc/apt/sources.list.d/ondrej-php-trusty.list
/etc/apt/sources.list.d/ondrej-php-trusty.list.save

It's in the source list, but it is still ignored. E.g. apt-cache search php7 gives always no result instead of an list.

I also destroyed the box an setup a new one.. but still the same issue.

Nico Richter
  • 135
  • 1
  • 2
  • 9
  • Can you update your post with a link to the exact version you are running with Ubuntu? Also, is there any reason you choose 14.04 instead of a newer Ubuntu distro? like 18? – Adan Rehtla May 11 '19 at 11:07
  • I am facing the same issue ... I can see the sources but it the ondrej/php repository not coming up when I run `apt-get update` Did you manage to solve the issue yet? – Dagmar May 16 '19 at 12:55

3 Answers3

6

I looked at the repository and it seems like 14.04 is no longer supported. Even though trusty is listed in the dist packages, when I looked into the pools there is nothing for ubuntu 14.04.

Take a look here:

http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.3/

That probably explains why the repository is not being included when you run

sudo apt-get update

I guess that server update can't wait any longer ;)

Dagmar
  • 2,968
  • 23
  • 27
1

Evening,

Are you running this as a bare metal system or a vagrant container?

As per the instructions from the PPA Launchpad webiste

Then you run:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

There is also a warning listed:
WARNING: add-apt-repository is broken with non-UTF-8 locales,
see https://github.com/oerdnj/deb.sury.org/issues/56 for workaround
# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php

Are you running a non-default locale?

There is also a post over on ASK Ubuntu and also Here which may be useful to you.

You could also double check that Ondřej Surý's PPA is in you sources list.

Try locate sources.list or locate *.list and try to find the repo.

There is a guide located over here which might also be helpful.

Adan Rehtla
  • 1,548
  • 2
  • 13
  • 26
  • Thanks for your response. It's running as an vagrant container and my default locales seems fine `LANG="en_US.UTF-8"`. Even with the forced LC_ALL command, it doesn't work. – Nico Richter May 11 '19 at 11:03
  • I updated my post with a link to another post with potential useful information. – Adan Rehtla May 11 '19 at 11:10
  • In the souce.list i can find `/etc/apt/sources.list.d/ondrej-php-trusty.list`.. I updated my answer. I've also tried many things in both of your links but it's always the same issue. I will try it later with a Ubuntu 18.04 box. But it's weird. Few weeks ago, I installed the same box with same settings in the same procedure and everything was okay. – Nico Richter May 11 '19 at 12:31
-1

It seems that the php packages are no longer available for box "ubuntu/trusty64" (more details here). I corrected this problem by setting config.vm.box = "ubuntu/xenial64" in Vagrantfile.

Mustapha GANGA
  • 505
  • 7
  • 12