Disclaimer

This guide is provided as-is. We do not offer support for the upgrade process. Proceed at your own risk.


How to Upgrade Ubuntu Server from 22.04 to 24.04 on Enhance

Upgrading your Ubuntu server to version 24.04 gives you access to the latest features, performance enhancements, and critical security updates. This guide walks you through the steps to upgrade Enhance servers safely, with key checks and tips included.


Step 1: Backup Your Server

Before you begin, create a full server backup. A snapshot is the recommended method—it allows easy restoration if something goes wrong during the upgrade.


Step 2: Fix Broken Packages

Ensure your package manager is functioning correctly:

bash

apt --fix-broken install

Step 3: Update Existing Packages

Update and upgrade all current packages:

bash

sudo apt list --upgradable sudo apt update && sudo apt upgrade -y reboot

Rebooting ensures all updates are properly applied.


Step 4: Ensure Upgrade Stability

To avoid SSH disruptions during the upgrade, open an alternative SSH port:

bash

sudo ufw allow 1022/tcp

Step 5: Install Upgrade Tools

Install the required upgrade utility:

bash

sudo apt install update-manager-core

Step 6: Start the Upgrade

Launch the upgrade process:

bash

sudo do-release-upgrade -d

If your server uses third-party mirrors, include the following flag:

bash
 
sudo do-release-upgrade -d --allow-third-party

Step 7: Clean Up Old Packages

After the upgrade, you'll be prompted to remove obsolete packages. Confirm with “Y” or defer cleanup as needed.


Step 8: Final Reboot

Apply all changes with a final reboot:

bash

reboot

Step 9: Post-Upgrade Fixes

1. Update Source Lists

Check for any renamed files and update them:

bash

sudo mv /etc/apt/sources.list.d/enhance.list.distUpgrade /etc/apt/sources.list.d/enhance.list sudo mv /etc/apt/sources.list.d/docker.list.distUpgrade /etc/apt/sources.list.d/docker.list

Replace jammy with noble in both:

bash

sudo sed -i 's/jammy/noble/g' /etc/apt/sources.list.d/enhance.list sudo sed -i 's/jammy/noble/g' /etc/apt/sources.list.d/docker.list sudo apt update && sudo apt upgrade

2. Reinstall PHP Packages

If your PHP websites are down after the upgrade, reinstall PHP versions:

bash

sudo apt install --reinstall appcd ecp-php{56,70,71,72,73,74,80,81,82,83} reboot

Conclusion

Upgrading to Ubuntu 24.04 is straightforward if each step is followed carefully. Always begin with a full backup—this is your safety net. Should anything go wrong, you’ll be ready to restore quickly and keep your services running smoothly. The above tutorial assumes you are using V11.

For V12 users

Check /etc/apt/sources.list.d/enhance.list. If it has been renamed to enhance.list.distUpgrade, rename it back to enhance.list. Replace "jammy" with "noble" if you have upgraded 22.04 to 24.04.

Then run:
apt update
apt install --reinstall ecp-php{56,70,71,72,73,74,80,81,82,83,84}
apt install --reinstall ecp-core

這篇文章有幫助嗎? 1 用戶發現這個有用 (1 投票)