Canonical has opened the gates to move from Ubuntu 24.04 to 26.04 so I am in the process to migrate my desktops and virtual machines to the latest LTS version. This has been a smooth process so far, until I got to the VM hosting one of my Prosody XMPP servers. While the update from 22.04 to 24.04 two years ago was smooth, I ended up with a broken install after the upgrade this time. I’d say this is mostly the LTS upgrade process fault and not Prosody’s. To make a long story short, two things broke during the upgrade:
- The apt repository files are modified and bricked by the Ubuntu Upgrade process, that needs to be fixed by hand
- The Lua installation (5.2) is not working any more after Ubuntu 24.04 to 26.04 despite still being there. Let’s use the opportunity to install lua5.4 and make Prosody use it. There is ‘sort of’ a hint about this here.
Fortunately, I did what I always do before such upgrades, I created a snapshot of the working VM, so I could rollback and experiment how to get things fixed without the fear of being left with a broken installation. Below are the commands I used to fix both issues in case you run into the same problem. BEWARE, use these commands with caution, think about what you do before you use them and MOST OF ALL: Have a snapshot of the VM or some other backup in case things go wrong!
## 1: Correct /etc/apt/sources.list.d/prosody.sources:
# Note: Make sure you have no old apt config file here
# The file MUST be present but broken. If it is empty, something
# else is wrong! Do not proceed!
#
sudo nano /etc/apt/sources.list.d/prosody.sources
Types: deb
URIs: http://packages.prosody.im/debian
Suites: resolute
Components: main
Architectures: amd64 arm64 i386 armhf
Signed-By: /etc/apt/keyrings/prosody.key
Enabled: yes
## 2. Set the second apt file change to 'resolute'
# The file MUST be present but broken. If it is empty, something
# else is wrong! Do not proceed!
#
sudo nano /etc/apt/sources.list.d/third-party.sources
## 3. Get the correct key in place for the Prosody repository
#
sudo install -d -m 0755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/prosody.key https://prosody.im/files/prosody-debian-packages.key
sudo chmod 0644 /etc/apt/keyrings/prosody.key
sudo rm -f /etc/apt/trusted.gpg.d/prosody*.gpg /etc/apt/sources.list.d/prosody.list
## 4. Install Prosody for resolute
# Check if prosody would be taken from the Prosody apt repository.
# Must say:
# Version table:
# 13.0.7-1~resolute2 500
# 500 http://packages.prosody.im/debian resolute/main amd64 Packages
#
# "packages.prosody.im" shows that the Prosody apt repository will
# be used and NOT the default Ubuntu / Debian repository
#
apt update
apt policy prosody
# Now install the correct Prosody version
#
sudo apt install --reinstall prosody prosody-modules
# At this point Prosody will fail because the system still points
# to lua5.2 and we need 5.4. So, let's install lua5.4
#
# Note: Will still give Prosody errors, will be fixed in the next step
sudo apt install lua5.4
# Now set lua to 5.4
sudo update-alternatives --set lua-interpreter /usr/bin/lua5.4
# And finally restart prosody, it should work now
sudo systemctl start prosody.service
sudo systemctl status prosody.service