Trying to update php version from 7.2 to at least 8.0

Ubuntu Linux = 18.04.6
Webmin version = 2.021
Virtualmin version = 7.7
All installed packages are up to date

when i try to Add the Ondřej Surý PPA repository, which provides the updated PHP packages by running the following command:

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

i get the following warning:

WARNING: add-apt-repository is broken with non-UTF-8 locales, see
Unable to add PPA Key · Issue #56 · oerdnj/deb.sury.org · GitHub for workaround:

After pressing enter the following script appears before me:
Hit:1 Index of /ubuntu bionic-security InRelease
Ign:2 Index of /ondrej/php/ubuntu 18.04.6 InRelease
Hit:3 Index of /vm/6/gpl/apt virtualmin-bionic InRelease
Hit:4 Index of /ondrej/php/ubuntu bionic InRelease
Hit:5 Index of /vm/6/gpl/apt virtualmin-universal InRelease
Err:6 Index of /ondrej/php/ubuntu 18.04.6 Release
404 Not Found [IP: 2620:2d:4000:1::3e 80]
Hit:7 Index of /ubuntu bionic InRelease
Hit:8 Index of /ubuntu bionic InRelease
Get:9 Index of /ubuntu bionic-updates InRelease [88.7 kB]
Reading package lists… Done
N: Ignoring file ‘ondrej-ubuntu-php-bionic.list.save.1’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘ondrej-ubuntu-php-bionic.list.save.2’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
E: The repository ‘Index of /ondrej/php/ubuntu 18.04.6 Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

why??? Just use the docs way to do things.
https://www.virtualmin.com/documentation/web/multiplephp/

the docs says use “LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update” to enable the ondrej/php repository but when i use this command i get the following script/text to see in the terminal

Ign:1 Index of /ondrej/php/ubuntu 18.04.6 InRelease
Get:2 Index of /ubuntu bionic-security InRelease [88.7 kB]
Hit:3 Index of /ubuntu bionic InRelease
Hit:4 Index of /ondrej/php/ubuntu bionic InRelease
Hit:5 Index of /vm/6/gpl/apt virtualmin-bionic InRelease
Hit:6 Index of /vm/6/gpl/apt virtualmin-universal InRelease
Err:7 Index of /ondrej/php/ubuntu 18.04.6 Release
404 Not Found [IP: 2620:2d:4000:1::3e 80]
Hit:8 Index of /ubuntu bionic InRelease
Get:9 Index of /ubuntu bionic-updates InRelease [88.7 kB]
Get:10 Index of /ubuntu bionic-updates/main amd64 Packages [3045 kB]
Reading package lists… Done
N: Ignoring file ‘ondrej-ubuntu-php-bionic.list.save.1’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘ondrej-ubuntu-php-bionic.list.save.2’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
E: The repository ‘Index of /ondrej/php/ubuntu 18.04.6 Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details

sorry, im so use to the Centos repo, my mistake.

Is PHP 8.0 + available for Ubuntu 18.04.6?

I think he is having issues with the repos, not installing 8. Unless they don’t support that OS.

i have provided my system details , and i believe you are right i am have issues with the repos

Ubuntu 18.04 is End of Standard Support Ubuntu Website release cycle page

So I’m not surprised

Even the PPA php repository for PHP only support Ubuntu 20.04

Even PHP8.0 is approaching EOL [Supported PHP]
(PHP: Supported Versions)

It just goes to show how important system updates are.

Why have you got some many source files ? It may be worth looking in /etc/apt/sources.d to see whats going on

i am using hostinger’s VPS hosting an they have provided me with the following combo:

Ubuntu Linux = 18.04.6
Webmin version = 2.021
Virtualmin version = 7.7

can i update the ubuntu version if i need to update the php version??

you can add a version but not update a version see Multiple PHP Versions – Virtualmin as already pointed out by stefan1959 Just follow the docs

not responding what is the alternate, does my sytem support the php version that i want to install or no, sombody please guied me in detail how can i come out of this problem

take me as a newbie, i understand things a little late

Why? It is obviously End of Standard Support No one should be using it unless they have to support old stuff. Ubuntu is now up to 23.04 (not yet supported by Virtualmin - why should they as being an odd number it goes EOL 2024)
Why not ask Hostinger to upgrade to 20.04 - or better still 22.04?

I’m still not sure why you are needing to go from PHP 7.2 to 8.x

@Stegan
i have tried to access the hostinger chat service and i wanted to ask them to updrage my php and ubuntu version both, and you said why i am trying to upgrade from PHP 7.2 to 8.x its because my all websites that are hosted on hostinger are demanding it, the message that i see on all admin panels of my WordPress websites is shown below

“Your site is running on an outdated version of PHP (7.2.24-0ubuntu0.18.04.17), which does not receive security updates. It should be updated.”

You don’t upgrade, you switch between versions.

If you running a VPS its normally your responsibility not your provider as they don’t have control over that.

I found this, it sounds like old repo that need to be removed I think.

see if you can find a old repo for ppa:ondrej/php and if its there remove it and try that command again.

this line indicates there is one there thats disabled
Updating from such a repository can’t be done securely, and is therefore disabled by default.

1 Like

I’m sorry you are having problems with them (Some hosting providers leave a lot to be desired) but I think your issue can really be down to the choice of OS. Do they not have telephone support?

I know in theory you could force an OS upgrade yourself but that is fraught with dangers as it is going back to bare box. At least going through them they should ensure the new image at least works. The end result is the same (you loose everything - unless you have a nice solid backup - somewhere safe. (I know DO Linode and others have “Volumes” you can park data backups) of course the backup will be out of sync with your live websites.

If I were in your shoes: I would work with each client halting their sites for maintenance. I would probably spin up a new clean box (probably with a new provider) and up-to-date OS. Install Virtualmin on that. Then go through the laborious job of transfering the domains and VS one at a time. or load from a backup. Then do some testing. One hell of a job not to be taken lightly.

Thanks for providing explanation of the PHP reason. WordPress (sigh! I will say no more) but I understand their complaint - afterall PHP 7.x is also EOL and even (8.0 before end of 2023 - time flies!)

@stefan1959

can you please tell how can remove the errors the i am encountering while updating when i use the command “sudo apt update”

Ign:1 Index of /ondrej/php/ubuntu 18.04.6 InRelease
Hit:2 Index of /vm/6/gpl/apt virtualmin-bionic InRelease
Err:3 Index of /ondrej/php/ubuntu 18.04.6 Release
404 Not Found [IP: 2620:2d:4000:1::3e 80]
Hit:4 Index of /vm/6/gpl/apt virtualmin-universal InRelease
Hit:5 Index of /ubuntu bionic InRelease
Get:6 Index of /ubuntu bionic-updates InRelease [88.7 kB]
Hit:7 Index of /ubuntu bionic InRelease
Get:8 Index of /ubuntu bionic-security InRelease [88.7 kB]
Reading package lists… Done
N: Ignoring file ‘ondrej-ubuntu-php-bionic.list.save.1’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘ondrej-ubuntu-php-bionic.list.save.2’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
E: The repository ‘Index of /ondrej/php/ubuntu 18.04.6 Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

delete these files

  1. /etc/apt/sources.list.d/ondrej-ubuntu-php-bionic.list.save.1
  2. /etc/apt/sources.list.d/ondrej-ubuntu-php-bionic.list.save.2

removed, now when i update this is what i see

Ign:1 Index of /ondrej/php/ubuntu 18.04.6 InRelease
Hit:2 Index of /ubuntu bionic InRelease
Err:3 Index of /ondrej/php/ubuntu 18.04.6 Release
404 Not Found [IP: 2620:2d:4000:1::3e 80]
Get:4 Index of /ubuntu bionic-security InRelease [88.7 kB]
Hit:5 Index of /vm/6/gpl/apt virtualmin-bionic InRelease
Hit:6 Index of /vm/6/gpl/apt virtualmin-universal InRelease
Hit:7 Index of /ubuntu bionic InRelease
Get:8 Index of /ubuntu bionic-updates InRelease [88.7 kB]
Reading package lists… Done
E: The repository ‘Index of /ondrej/php/ubuntu 18.04.6 Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

how can i remove:

Err:3 Index of /ondrej/php/ubuntu 18.04.6 Release
404 Not Found [IP: 2620:2d:4000:1::3e 80]

&

please explain the follow:
E: The repository ‘Index of /ondrej/php/ubuntu 18.04.6 Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

now find the correct file I guess that to be ondrej-ubuntu-php-bionic.list
edit that to something like this

deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main

if this fails I would guess the repository has been deleted and you need to upgrade to a later version of Ubuntu