Hi All. I have been trying to upgrade to PHP8 but keep failing. I tried the following command and various more from the internet but nothing helped.
Below command was issued:
sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php8.1
But the application keep on responding with such:
E: Unable to locate package php8.0 E: Couldn’t find any package by glob ‘php8.0’ E: Couldn’t find any package by regex ‘php8.0’
Below are my OS details (VPS):
NAME=“Ubuntu” VERSION=“16.04.7 LTS (Xenial Xerus)” ID=ubuntu ID_LIKE=debian PRETTY_NAME=“Ubuntu 16.04.7 LTS” VERSION_ID=“16.04” HOME_URL=“http://www.ubuntu.com/” SUPPORT_URL=“http://help.ubuntu.com/” BUG_REPORT_URL=“http://bugs.launchpad.net/ubuntu/” VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial
If I am required to upgrade my VPS, can someone guide me to do so? I am not used to develoment stuff and I have WordPress on my VPS. So how can I upgrade (if required) without losing all those stuff there?
Thank you in advance.
Regards, Jasveer
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey @jasveer,
I can see you have an Ubuntu 16.04, that’s a really really really old one and it has been EOF a long time ago. You’ll need to upgrade it as soon as possible.
To do so, you can follow these steps:
remove unused packages and files
- sudo apt autoremove -y **&&** sudo apt autoclean -y
Upgrade commands
- sudo apt update -y **&&** sudo apt upgrade -y **&&** sudo apt dist-upgrade -y
Of course, before you run that, I’ll suggest creating a snapshot just to be safe in case something fails:
https://docs.digitalocean.com/products/images/snapshots/
As for enabling PHP 8, usually the following works for updated systems :
- sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
then enabling the repo
- sudo add-apt-repository ppa:ondrej/php
and lastly, instaling php 8:
- sudo apt install php8.1
Hello @jasveer
As with almost any upgrade between major releases of an operating system, this process carries an inherent risk of failure, data loss, or broken software configuration. Comprehensive backups and extensive testing are strongly advised.
To avoid these problems, we recommend migrating to a fresh Ubuntu 22.04 server rather than upgrading in-place. You may still need to review differences in software configuration when upgrading, but the core system will likely have greater stability. You can follow our series on how to migrate to a new Linux server to learn how to migrate between servers.
https://www.digitalocean.com/community/tutorial_series/how-to-migrate-to-a-new-linux-server
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.