I upgraded my server from Ubuntu 18.04 to 20.04 but Settings Overview still shows 18.04

I upgraded my server from Ubuntu 18.04 to 20.04 because I am still on Nextcloud 23.0.12 but want to begin migrating to the latest version. I verified my server is now running Ubuntu 20.04.6 LTS using hostnamectl. Nextcloud 23 thankfully runs after the server upgrade, however it still thinks I am running Ubuntu 18.04. Can anyone advise why? I cleared cookies and cache from the browser but no success. Message from Settings-Overview is below. Thanks as always.

here are some warnings regarding your setup.

  • You are currently running PHP 7.3.33-1+ubuntu18.04.1+deb.sury.org+1. Upgrade your PHP version to take advantage of performance and security updates provided by the PHP Group :arrow_upper_right: as soon as your distribution supports it.
  • Nextcloud 23 is the last release supporting PHP 7.3. Nextcloud 24 requires at least PHP 7.4.
lsb_release -a

This refers to the installed php package.
A server update, specially when you have PPA apt-sources in use, is not complete, if you did not update those apt-sources as well.

I can help you in depth but will try to give you all the information needed to solve it at your own:

  • List the apt sources:
ls /etc/apt/sources.list.d/

Since you makes use of ondrejs PPA for php, you may have a file named


with this content:

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

So, that one is old and you must:

  1. change the name of the file:
mv /etc/apt/sources.list.d/ondrej-ubuntu-php-bionic.list /etc/apt/sources.list.d/ondrej-ubuntu-php-focal.list
  1. and its content:
sed -i '/s/bionic/focal/g' /etc/apt/sources.list.d/ondrej-ubuntu-php-focal.list

then run

sudo apt-get update

Now you are ready to update to a new php-version that will bear the name of the ubuntu-version you are running.

If your php was set up correct, you can use php-updater to install a new php-version.

sudo wget -O /usr/local/bin/php-updater https://global-social.net/apps/raw/s/php-updater
sudo chmod +x /usr/local/bin/php-updater

This script is specially then verry helpfull, when only one php-version is installed.

You can see, what php versions and packages are installed on your server with this command:

dpkg -l | awk '/^ii.*php/ {print $2}'

So if your perfectly runing php version is 7.3 and you see some packages from other (older or newer) php-versions, you should

sudo apt-get remove --purge *php$version*

them first. $version in this example has to be replaced by the versionstring you want to remove.

After you have done that, you can run php-updater.

If you need more help, e.g for how to activate the new php-version for your server, then I need more information about the webserver and the php-sapi you are using.

Much luck,

Ah, thank you! That makes complete sense that it is referring to the php package. I will follow your recommendations this weekend to update the php version when I have a bit more time. In the meantime, I marked this as “solved” since you clearly answered my original question. But the steps to follow to update php, which really was my goal, are immensely appreciated. Thanks again!

1 Like

Thanks again, PHP was upgraded from 7.3 to 7.4 and then to 8.1. Nextcloud upgraded from 23 to 27, have one issue I think is minor I’ll need to open a new request for.

1 Like