This is how I did it. It doesn’t mean it’s the best way or the only way. It just worked for me and I’m happy to share it with you.
First of all it’s never enough repeat that you MUST do backup and snapshot of the server so if anything goes wrong you can rollback to the original position and be ready for another try.
Get ready for at least an hour of downtime. Upgrade all this packages may take some time.
You also MUST have Carbonio already upgraded to version 24.03 before proceed.
Follow the official Carbonio CE Upgrade from 24.1 to 24.3.0
Preparing
Your server must have all packages and dependencies satisfied. To be sure it’s all right run:
apt update ; apt upgrade
You must be sure there is nothing to fix, add or remove. If so, fix it.
Be sure there is no services setup to be done. To be sure run:
pending-setups -a
Stopping Carbonio
Before upgrading stop Carbonio to prevent services corruption. So run:
su - zextras -c "zmcontrol stop"
Time to upgrade Ubuntu
Ubuntu have its own tool to do it and it will upgrade a LTS server to the next version of LTS available. So once you run the command below, just follow the flow and it will upgrade Ubuntu Server 20.04 LTS to 22.04 LTS.
do-release-upgrade
It will make you some questions and you may answer them to fit your needs. In my case I just press yes for everything and kept my own conf files in the way.
If you want more details about what that command do I recommend you to visit Ubuntu’s upstream documentation.
It take a while to download an process it all. It ends asking to reboot the server. Do it.
Upgrading Carbonio to use Jammy repository
Once Ubuntu is back and running you have to fix Carbonio’s apt repository from focal to jammy. To do it edit the file zextras.list and replace it:
vi /etc/apt/sources.list.d/zextras.list
* replace focal for jammy
* be sure the line is discommented
You should do the same for PostreSQL
vi /etc/apt/sources.list.d/pgdg.list
* replace focal-pgdg for jammy-pgdg
* be sure the line is discommented
Updating the new repository
Once that file is fixed it’s time to update the repository. To do it run:
cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/
apt update
Fixing apt database for upgrade
In my tests upgrading Carbonio to Jammy didn’t work as expected. Many packages remained as “focal” even after the upgrade. You can see it by your self running:
dpkg -l | grep focal
So here is how I fixed it:
cp -a /var/lib/dpkg/status /var/lib/dpkg/status.orig
cat /var/lib/dpkg/status.orig | sed s/"Version: .*focal"/"Version: 0"/g > /var/lib/dpkg/status
First command just make a copy of the original status file. It’s never too much have a backup, right?
Second one replace versions numbers on all focal packages that are installed. It forces apt to pull jammy versions for all of it.
Upgrading Carbonio to jammy
Finally it’s time to upgrade Carbonio. So run:
apt update ; apt upgrade
Just let it work and don’t worry much about error messages. We still need to do some steps afer that to get it all running.
Fixing minor errors
As you may have seen not all worked out, so we need to fix permissions and then upgrade again.
/opt/zextras/libexec/zmfixperms
apt upgrade
Fixing setups
After all those upgrades you must run pending-setups:
pending-setups -a
NOT GOOD ENOUGH?
If after that you still have problems then it’s time for brute force!
apt reinstall $(dpkg -l |grep carbonio.*perl|awk '{ printf " "$2 }'| tr '\n' ' ' ; echo)
Have in mind this is the last resort. I strongly suggest you to start again from scratch.
Logrotate error for carbonio.log
It seems that logrotate setup for carbonio.log came with an error that prevents it from loging anything. After the upgrade you must do this fix to get it up and running as expected.
1 – edit /etc/logrotate.d/carbonio
vi /etc/logrotate.d/carbonio
2 – Replace the two lines after the first “postrotate” in the carbonio.log area to be like that:
[ -x /usr/lib/rsyslog/rsyslog-rotate ] && /usr/lib/rsyslog/rsyslog-rotate || true
su - zextras -c "/opt/zextras/bin/zmconfigdctl restart" > /dev/null 2>&1 || true
Watch tabulation to respect logrotate conf files syntax
3 – Save the file
New setup will take place after the server reboot… what is your next step =)
Reboot
To end it all, you must reboot your server
reboot
After all done, it’s not finished
All this procedure leaves some trash behind and for the sake of your apt database I recommend you to deal with it right away.
To see if there is some apt misleading on it’s database run:
apt update ; apt upgrade
It might ask you to remove some unnecessary packages and that’s what we need to fix. Just take the list of it and ask it to install it all over agai.
In my case the list of packages looked like this:
libasn1-8-heimdal libffi7 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libicu66 libjson-c4 libkrb5-26-heimdal libldap-2.4-2 libllvm10 libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libroken18-heimdal libssl1.1 libwind0-heimdal python2 python2-minimal python2.7 python2.7-minimal
So I asked apt to install it:
apt install libasn1-8-heimdal libffi7 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libicu66 libjson-c4 libkrb5-26-heimdal libldap-2.4-2 libllvm10 libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libroken18-heimdal libssl1.1 libwind0-heimdal python2 python2-minimal python2.7 python2.7-minimal
As I can’t assure your list of packages will be the same, just do it with the list of packages it shows to you.
Essentially what that will do is setup those packages correctly on apt database and the “apt autoremove” will no longer be shown.
That’s it!!!