SYSTEM INFORMATION | |
---|---|
OS type and version | Ubuntu 22.04 |
Webmin version | 2.202 |
Virtualmin version | 7.20.2 |
Webserver version | apache 2.4.62 |
Related packages | Ondrej (PHP and Apache) |
I had a really hard time upgrading a Virtualmin server from Ubuntu 22.04 to Ubuntu 24.04. In the end, I managed to do it, so I want to share the steps I followed to succeed.
The problem was that if I used sudo do-release-upgrade
(choosing to keep the previous configuration files), the system would boot, but Virtualmin would end up without Apache installed. Even if I reinstalled Apache from within Virtualmin, it would install, but no websites would work.
Regarding repositories, besides the ones from Ubuntu and Virtualmin, I had two from Ondrej (one for the different PHP versions and one for Apache!). It seemed that this was the root of the problem.
Fortunately, I have the system virtualized, so by using snapshots, I could test and roll back to the previous state repeatedly.
After several tests (and carefully reviewing this thread), I found a solution that doesnāt align with the ones Iāve seen on the forum. Hereās what I did:
- Before starting the upgrade, I modified the Ondrej repositories to point to ānobleā with this command:
sudo sed -i ās/jammy/noble/gā /etc/apt/sources.list.d/ondrej-*.list
VERY IMPORTANT: After running that command, I did not run sudo apt-get update
or sudo apt-get dist-upgrade
. I only executed that command to change the repositories.
-
I ran
sudo do-release-upgrade
. When prompted to update any configuration files to the current version, I chose no. -
After doing this, the system booted without errors, and the websites worked right away! Everything seemed to work fine, but if I ran
sudo apt-get update
at that point, I encountered errors with the Ondrej repositories again due to encryption keys. -
So, after trying several options again, I decided to remove the Ondrej repositories and re-add them (without doing updates in between). The command sequence went something like this:
sudo add-apt-repository --remove ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/apache2
sudo apt update
Now I could run sudo apt-get update
and sudo apt-get dist-upgrade
, and everything was perfectly installed (at least in my case).
I tested the websites and the mail server, and everything works without issues.